View Full Version : Can you pass in properties to a Prerequisite?

Tim Mayert
10-06-2010, 10:02 AM
One of my basic MSI installs has to include Java JRE in static mode, so I created a prerequisite that will launch the Java JRE install .exe file in silent static mode. This all works fine, but since it is installed in static mode we want to be able to specify the INSTALLDIR so that it installs the Java JRE under our application folder, into a sub-folder.

So I would like to know if there is a way I can pass in a property to this pre-requisite to have it's INSTALLDIR redirected to our product folder?

I can place the folder name into the pre-requisite itself, but then the parent would have to be restricted to that folder and therefore not allow the user to change it. so if this is possible then let me know how.


10-06-2010, 10:41 AM
This depends on when you're installing this prerequisite. INSTALLDIR is generally not known at the time a Setup Prerequisite is installed, so if you are using a Setup Prerequisite, you would be restricted to choosing your installation folders without user feedback. However Feature Prerequisites can reference any property in their command line, and they are executed after INSTALLDIR is specified in the UI sequence. See "Specifying Command-Line Parameters for an InstallShield Prerequisite" in the help for some more information.

02-08-2011, 05:19 AM

I have the same problem. I use Feature Prerequisites and I can't change the INSTALLDIR value of prerequisites.

I fill the field "Specify the command line for the application" for each feature prerequisites with the following value :

/s /v"/qn ALLUSERS=1 /norestart INSTALLDIR=[INSTALLDIR]"

What's wrong with my command line ?



02-08-2011, 12:57 PM
I just change the order of my arguments and it's works !

/s /v"/qn ALLUSERS=1 INSTALLDIR=[INSTALLDIR] /norestart"