Reputation: 427
I'm currently building an installer that installs different components depending on if a switch is invoked on startup
Setup 1: trigger installer
Setup 2: trigger installer with argument /vSERVERTYPE=Server
When Setup 1 is triggered i want to hide a feature from the user
I Currently have the following InstallShield InstallScript code to do so:
if(serverInstallSwitch != "Server") then
MessageBox("Not a server install", INFORMATION);
FeatureSetData (MEDIA,
"Sybase_Database_Service_64bit",
FEATURE_FIELD_VISIBLE, FALSE,
"");
endif;
This however does not work, it does show the messagebox "Not a server install" but it does not hide the feature.
What am I doing wrong?
Upvotes: 0
Views: 169
Reputation: 15905
This doesn't look complete; how do things get from /vSERVERTYPE=Server to serverInstallSwitch
? From the command line format, I'm expecting this is an MSI-based install, hopefully a Basic MSI with custom actions. Thus I would expect to see a call to MsiGetProperty(... "SERVERTYPE" ...)
, and use of Feature Conditions to hide the feature. (Note that this requires setting the level to 0, and doing so has risks if you don't do it all of the time, so employ some sort of remember property pattern. (Actually for a Basic MSI you should take it one step further and avoid using custom actions for this entirely.)
If this is pure InstallScript, look instead into the /z parameter and the CMDLINE variable. I would expect to see code that queries the CMDLINE variable, perhaps with the %
operator. Then your call to FeatureSetData call is more likely to be correct.
If you are using InstallScript MSI, you'll have to experiment to see which parts of those approaches work. It's not always easy to predict which things use the Basic MSI approach, which use the InstallScript approach, and which can use either.
Upvotes: 1