View Full Version : Conditional installation of service
12-13-2005, 04:19 PM
In my installer, I am giving the user a choice between a server and client installation type. If the user selects server, then I want to install a service and start it. I changed the labels on the SetupType dialog so that Typical = Server and Custom = Client. (On a side note, I tried to change the Values for the typical/custom radio buttons, but the changes wouldn't stay.)
I have tried to accomplish the conditional service install by expanding on the conditions for InstallServices and StartServices in the Sequences view of InstallShield 11.5 for Visual Studio .NET 2005. For the conditions, I put:
VersionNT AND _IsSetupTypeMin = "Typical"
However, it is not working as I expected it to. It is installing and starting the service no matter what the value of _IsSetupTypeMin is. :confused:
Any help would be most appreciated!!
12-13-2005, 06:07 PM
The issue might be that _IsSetupTypeMin is a "private property" (its name contains lowercase letters), and therefore its value is reset between the User Interface sequence (where the property is set by the dialog box) and the Execute sequence (when services are manipulated).
Perhaps change the radio button group's property to an all-caps public property name, or define your own public property based on that same radio button group?
12-14-2005, 12:07 PM
Thank you so much for the reply! I changed the _IsSetupTypeMin to SETUP_TYPE and it worked!
Another question for you: I am using the same logic to install two different sets of registry information based on the SETUP_TYPE. To do this, I created two components where I can specify a condition. Is this a good approach, or is there a better way to do it?
My components are: RegistryComponent_Client with condition SETUP_TYPE = "Client", and RegistryComponent_Server with condition SETUP_TYPE = "Server". When I perform a server install, the registry keys and values are installed. When I perform a client install, nothing is installed to the registry. When I look in the Components view, the icon beside the RegistryComponent_Client has a red exclamation point on it. I am guessing that this means something is not right with this component, but I don't know what the problem is. I have attached a screen shot of the Components.
Once again, I am very grateful for your assistance!
12-14-2005, 12:14 PM
For a start: The red exclamation point means that the component isn't included in any feature, and therefore can't be installed. To add the component to a feature, open the Setup Design view, right-click a feature, and select Associate Components...
12-14-2005, 03:59 PM
Thank you, Robert! It worked!
One more question....
I have a custom action that attaches a database that is installed with my program during a server install. It is not executing as I have it set up now, and I have a feeling that I don't have it sequenced correctly. I am attaching a screen shot of the current settings.
Any suggestions will be most appreciated!
12-14-2005, 04:05 PM
Perhaps remove the instance in the Install UI Sequence, since the Execute sequence version will run for both silent and full-UI installations. You'll then want to use Always Execute and Deferred Execution to ensure it runs when data transfer is complete (assuming ScheduleReboot occurs after InstallFiles)...
12-16-2005, 01:46 PM
Thanks for your help, Robert. I got it working.
For anyone who is interested, the attached screenshot shows the settings which worked for me. I found two other threads in the InstallShield community forums which greatly helped me as well:
Install Exec Condition (http://community.installshield.com/showthread.php?t=124874)
Custom Actions Only During Install or Uninstall (http://community.installshield.com/showthread.php?t=153363)
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.