InstallShield 11 Custom Action only for selected components

Posted on 2009-04-20
Medium Priority
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
  • 2

Author Comment

ID: 24192351
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

jmcmunn earned 2000 total points
ID: 24200656

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 condition...it 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

ID: 24202320
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


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the frequent problems with the installations is when some file or registry entry is not removed from the system upon un-installation of the product. Clean removal is always highly desirable. One major reason for that is badly authored inst…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

850 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