Here's my Fragment
<Fragment>
<Variable Name="Hasp_BundleVersion" Value="7.54.8889.1" />
<Variable Name="Hasp_IsInstalled" />
<Variable Name="Hasp_InstalledVersion" />
<util:RegistrySearch Id="Hasp_IsInstalled"
Variable="Hasp_IsInstalled"
Root="HKLM"
Key="SOFTWARE\Aladdin Knowledge Systems\HASP\Driver\Installer"
Value="Version"
Result="exists" />
<util:RegistrySearch Condition="Hasp_IsInstalled"
After="Hasp_IsInstalled"
Variable="Hasp_InstalledVersion"
Root="HKLM"
Key="SOFTWARE\Aladdin Knowledge Systems\HASP\Driver\Installer"
Value="Version"
Result="value" />
<PackageGroup Id="Hasp">
<ExePackage Id="Hasp"
DisplayName="Hasp"
SourceFile="setups\HASPUserSetup.exe"
Compressed="yes"
DetectCondition="Hasp_IsInstalled AND Hasp_InstalledVersion >= Hasp_BundleVersion"
InstallCommand="/s /v/qn"
PerMachine="yes"
Permanent="yes" />
</PackageGroup>
</Fragment>
This doesn't work, because it seems like it is comparing the two values as strings. Here's the log:
[0A74:0A4C][2017-03-29T16:29:02]i000: Initializing string variable 'Hasp_BundleVersion' to value '7.54.8889.1'
[0A74:0A4C][2017-03-29T16:29:02]i000: Setting numeric variable 'Hasp_IsInstalled' to value 1
[0A74:0A4C][2017-03-29T16:29:02]i000: Setting string variable 'Hasp_InstalledVersion' to value '7.54.66980.1'
[0A74:0A4C][2017-03-29T16:29:02]i052: Condition 'Hasp_IsInstalled AND Hasp_InstalledVersion >= Hasp_BundleVersion' evaluates to false.
If I change to type Version
, it doesn't work either:
<Fragment>
<Variable Name="Hasp_BundleVersion" Type="version" Value="7.54.8889.1" />
<Variable Name="Hasp_IsInstalled" />
<Variable Name="Hasp_InstalledVersion" Type="version" Value="0.0.0.0" />
<util:RegistrySearch Id="Hasp_IsInstalled"
Variable="Hasp_IsInstalled"
Root="HKLM"
Key="SOFTWARE\Aladdin Knowledge Systems\HASP\Driver\Installer"
Value="Version"
Result="exists" />
<util:RegistrySearch Condition="Hasp_IsInstalled"
After="Hasp_IsInstalled"
Variable="Hasp_InstalledVersion"
Root="HKLM"
Key="SOFTWARE\Aladdin Knowledge Systems\HASP\Driver\Installer"
Value="Version"
Result="value" />
<PackageGroup Id="Hasp">
<ExePackage Id="Hasp"
DisplayName="Hasp"
SourceFile="setups\HASPUserSetup.exe"
Compressed="yes"
DetectCondition="Hasp_IsInstalled AND Hasp_InstalledVersion >= Hasp_BundleVersion"
InstallCommand="/s /v/qn"
PerMachine="yes"
Permanent="yes" />
</PackageGroup>
</Fragment>
Log:
[1B40:0CEC][2017-03-29T16:42:23]i000: Initializing version variable 'Hasp_BundleVersion' to value '7.54.8889.1'
[1B40:0CEC][2017-03-29T16:42:23]i000: Initializing version variable 'Hasp_InstalledVersion' to value '0.0.0.0'
[1B40:0CEC][2017-03-29T16:42:23]i000: Setting numeric variable 'Hasp_IsInstalled' to value 1
[1B40:0CEC][2017-03-29T16:42:23]i000: Setting string variable 'Hasp_InstalledVersion' to value '7.54.66980.1'
[1B40:0CEC][2017-03-29T16:42:23]i052: Condition 'Hasp_IsInstalled AND Hasp_InstalledVersion >= Hasp_BundleVersion' evaluates to false.
I'm using Variables
, because I need to access the values later in my custom bootstrapper.
What am I doing wrong?