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

Making service depencies conditional on OS version

Hello,

We have a service that has a dependency on a windows service in Windows Server 2003 and XP, but does not have any dependencies in Server 2008, Vista, or Windows 7.

The executable for the various versions of Windows is the same. An underlying service in the OS just got refactored so that our dependency goes away.

Anyone have advice how to organize a component service's dependencies so that they are conditional on the underlying OS? Currently our best theory is to try creating two separate components that are identical except for their dependencies and install conditionally according to the installed OS. Looking for more knowledgeable suggestions, however.

Thanks for your time!
Labels (1)
0 Kudos
(4) Replies
shmooerific
Level 4

Oops, noticed a similar thread on the v12 forum, although the thread has been dormant for 2 years. Revived it just in case anyone there has new wisdom.
0 Kudos
cbragg
Level 7

That's one way to go or maybe you could add once service with a dependancy in the form of a property. Then just populate that property based on OS instead
0 Kudos
shmooerific
Level 4

Hi cbragg, thank you for your suggestion.

I was wondering if properties could be adapted for this purpose. That's great if they can.

BTW, please excuse my ignorance of the available options... I am pretty much a newbie when it comes to InstallShield. My first reaction is that it sort of reminds me of some unix tools - complicated and obtuse but quite powerful once you can figure out how to make it go. 🙂
0 Kudos
shmooerific
Level 4

Hi all,

Got my dependencies working. Will include the details here for the sake of other newbies like me who don't know InstallShield well enough to follow cbragg's advice easily.

1. Add a new property, "MyProperty" under Behaviour and Logic -> Property Manager. Give it some default value, or leave empty if appropriate as a default.
2. Set the service Dependencies (under Organization -> Components -> -> Advanced Settings -> Install NT Services) to "[MyProperty]". If you are not familiar with working with properties, note that [] is the syntax for invoking a property.
3. Add a Type 51 custom action to set your property, under Behaviour and Logic -> Custom Actions and Sequences. You will want to edit the Install Exec Condition field to make the custom action conditional, however the appropriate field was probably not added automatically and I don't know how to add it manually. The work-around is to use the "Custom Action Wizard" instead of using "New Set Property" when creating your custom action. The wizard will lead you through the fields, and will include the Install Exec Condition field.
4. Set your Install Exec Condition field to check the value of the VersionNT property, e.g. "VersionNT < 600". This will cause your action to change the value of the property only on specified versions of Windows.
5. Add your custom action to the install sequence. Make sure it is before the CostFinalize step if the property being set will also be used in any conditions on features or components.
6. Test and feel relieved.
0 Kudos