I have a PRQ that installs MS SQL Shared Management Objects. I have a condition that installs the PRQ if this registry key does not exist
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{08ECC740-2B3E-45D7-860C-59B511386286}
This works fine until a user has SMO installed with a different product code - this happens to our dev team all the time when they install SQL2008. The installer the PRQ starts exists with an error.
I need a better condition. What I'd like to do is: If (Version <= w.x.y.z || No Version found) Then install PRQ
In the InstallShield Prerequisite editor it says
The Following conditions must be met for the prerequisite to run. Here you can define files and registry keys that the prerequisite will look for to determine if it should be run. If there are no conditions, the prerequisite will always run.
This agrees with my findings - the conditions are ANDed together. Is there some unpublished sauce to OR or negate conditions in the XML? I'm vexed right now because looking to run a prq if the version in the registry is < what I'm installing.
<conditions>
<condition Type="32" Comparison="2"
Path="HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\SharedManagementObjects\CurrentVersion"
FileName="Version" ReturnValue="10.1.2531.0">
</condition>
</conditions>
Type="32" is 'A registry entry has a specified version value' Comparison="2" is 'Data on target system is less than specified data'
Side question: Is there a place where the Types and Comparisons are enumerated?
This Comparison type doesn't have a comparison to state 'Data on target system is less than specified data or does not exist'. As it is now, if the key exists at a lower version things work - but if the key doesn't exist (i.e. SMO isn't installed) the PRQ isn't installed.
Is there a way to make this work? The 'A file with certain version exists' condition does have a If the file's version is LESS THAN the version specified above (or the file IS NOT FOUND on the target system) option. But it won't work to check a file installed by SMO - the user may have installed it to some drive other than C:.
I'm hoping I'm missing something. What would you do?
What I typically do is not use abstract things like ARP entries to detect the dependency. I go for the dependency itself. If you need a DLL then look to see if the DLL is there instead of worrying about detecting something that should have installed the DLL.