cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cs1234
Level 4

Feature prerequisites during silent install

I'm having trouble getting my feature prerequisites to install when running a silent install from the command line. I'm not sure what I'm missing.
I have a Basic MSI setup project, that installs 3 features one with a prerequisite (sql server 2005). It always installs all 3 features, and the user is not given the option to select the features to install in the UI mode.

The error in the install log:
Action start 10:11:19: ISInstallPrerequisites.
InstallShield 10:11:19: No features with associated prerequisites are being installed or advertised. Skipping prerequisites.

What do I need to do to make it recognize that I am installing a feature with a prerequisite?

Thanks,
Caroline
Labels (1)
0 Kudos
(11) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

How are you launching your installation? This should be handled automatically from a setup.exe /v"/qn" style silent install, and should be impossible from an msiexec /qn style silent install. (The former has special handling for feature prerequisites; both it and the latter skip the UI sequence which is the normal entry point, but the latter has no way to do special handling.)
0 Kudos
cs1234
Level 4

Using the Setup.exe /v"/qb" style command line.
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

What do you see related to the prerequisites in the debuglog? (Add /debuglog to the command line for setup.exe - not inside the /v.)
0 Kudos
cs1234
Level 4

Ah, that helps. Thanks a lot.
I found that it was failing one of the conditions.
I accidentally put one of my actions, which sets a registry key that the prerequisite checks, in the wrong sequence, so it wasn't getting run.
0 Kudos
cs1234
Level 4

During silent mode, do the Feature prerequisites get checked before other custom code can run?
I have an action that checks a variable and sets a regkey that is used as a condition for the prerequisite. And it seems that the conditions are checked before this action runs. It is set to run before CostFinalize with Immediate Execution.
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Yes. Feature prerequisites have to occur outside the InstallExecute sequence in order to support prerequisites that include Windows Installer setups. For full-UI installs, we launch them shortly before ExecuteAction. For silent setups, there is only the InstallExecute sequence, so we launch them from setup.exe before running the MSI.

For your case, if you can represent the check directly in the prerequisite conditions, I'd suggest that you do so. Alternately, you may want to explore creating an InstallScript installation or other custom exe as a bootstrap around your current setup.exe, and pull the registry key generation out to there. I'd avoid the latter if possible.
0 Kudos
cs1234
Level 4

Is there any way that I can get my properties set before the prerequisites run? The properties that I pass in on the command line. They don't seem to set the values until after the prerequisites run as well.

(Specifically, I pass in the SA password that I want to install sql server with, which is passed to the prerequisite installer through it's command line, but the value doesn't seem to be getting through).
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

This should work fine. Did you make sure to specify a silent command line for the prerequisite that uses the property? I tested with a notepad prerequisite, passing PROP1="MiKe" in the command line, and using [PROP1] in the prerequisite's command line, and "MiKe" was passed.
0 Kudos
cs1234
Level 4

we specify the silent command line for the prereq as
/qn ADDLOCAL=ALL INSTANCENAME=MYINSTANCE SECURITYMODE=SQL SAPWD=[SQL_SA_PASSWORD]

But when it installs it appears to not substitute in this value. Later when we try to connect to sql server with the password that was specified it does not work. In fact, if I try to log in with "[SQL_SA_PASSWORD]" as the password, it connects. If I go through the UI install (it also uses the same prereq command line), connecting works correctly (the specified password, not the property name).

I tried also setting that value using the System Search functionality, in case that would help, but it didn't seem to.

(I ended up creating a batch file that would create the registry key that I needed for the condition check on the prereq, and also temporarily stored the password value in the registry, so I could pull it out with the system search.)

The following is the command line that I'm using to call setup.exe, maybe I'm doing something wrong with it?

setup.exe /v"/qb INSTALLSQLSERVER=1 SQL_SA_PASSWORD=A!ra2235A!ra INSTALLDIR=\"C:\\Program Files\\MyCompany\\MyProduct\\\" /L*v C:\install.log" /debuglog
0 Kudos
cs1234
Level 4

I think I figured out what was happening. It seems to only pass the parameter in correctly if I use the /s /v"qn" options instead of /v"qb" option. If I use the full silent install method then it works ok.
Thanks.
0 Kudos
rasky74
Level 6

I believe the prerequisite feature is part of the setup.exe bootstrapper. Maybe write a basic msi that does your custom action and then sequence it before your other prereqs.
0 Kudos