InstallShield 11 Custom Action only for selected components

Posted on 2009-04-20
Last Modified: 2013-11-14
I have an InstallShield MSI installation with a custom action which runs a VBScript file to determine if a database already exists and deletes it if it does.  I am extending the installation to allow just the UI to be installed and now can select whether to install the Application (UI) and/or the Database component.  So within 'Setup Types' I have the common type with two selectable Features - 'Application' and 'Database'

If the user decides to only install the UI I want to prevent the custom action from being run as in this case I want to connect to an existing database and do not want to delete it.  I can't seem to find a way in which a custom action can be set to only run if a specific Feature is installed.
Question by:ChrisMDrew

    Author Comment

    I got part of the way there - hopefully someone will be able to comment what the problem is now...

    Under 'Custom Actions' I have selected the action I am interested in and gone to its 'Install Exec Condition' field.  This was set to 'NOT Installed AND NOT REINSTALL' meaning that the custom action would only be run as the product is being installed.  So far so good.  The two features in the installation are called 'Application' and 'Database' and so I have extended the condition to be


    I found somewhere on the InstallShield site that 3 means the component is to be installed.  Now when I run the Installation it seems that the condition is never satisfied and so the custom action is never performed which is part of the way there I guess!

    Can anyone see anything wrong with this condition?
    LVL 12

    Accepted Solution


    Try this if you only want it to run when the Database feature is installed (or being installed):

    &Database=3 OR !Database=3

    (Notice the ! in front of the second kind of blends in on my monitor)  This should take care of the condition without checking Not Installed or anything else I think.

    According to the info I can find...

    If a feature is selected for installation:
    This will be true if the feature_name is selected for installation.

    If a feature is not selected for installation:
    NOT &feature_name=3

    The feature is already installed:

    Author Comment

    Yes - this does seem to work and was more or less what I thought - my problem seems to have been WHERE in the process the check was being done.  I moved the check immediately priot to the start of the SQL processing section which is a lot later in my setup and now it works.  Odd as I would have thought the features would have been configured as soon as you chose them but this does not seem to be the case.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Installations often have prerequisites, such as “Microsoft .Net framework is required for this product”. The usual implementation in MSI installations is system search for a particular registry setting representing the required prerequisite, followe…
    I have been scripting applications way too long and can never remember how to create an ISS file.  So I decided to write this article to act as my own knowledge base for future reference, and hope you will also benefit. An ISS file is a response …
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now