Functions

src/CustomActions/SystemTools/CompareVersionImpl.h File Reference

Go to the source code of this file.

Functions

CA_API UINT __stdcall CompareVersions (MSIHANDLE hInstall)
 Compares dotted version strings.
CA_API UINT __stdcall CompareVersion (MSIHANDLE hInstall)
 Compares dotted version strings.

Function Documentation

CA_API UINT __stdcall CompareVersion ( MSIHANDLE  hInstall  ) 

Compares dotted version strings.

Compares the version string specfied by VERSION_INSTALLED to the version specified by VERSION_MINIMUM and optionally, VERSION_MAXIMUM. If VERSION_INSTALLED lies between these two versions, then the property specified by VERSION_PROPERTY is set.

Parameters:
VERSION_INSTALLED version to compare
VERSION_MINIMUM mimumum allowed version
VERSION_MAXIMUM optional paramater specifying the maximum version allowed
VERSION_PROPERTY property to set if the version check passes
CA_API UINT __stdcall CompareVersions ( MSIHANDLE  hInstall  ) 

Compares dotted version strings.

Compares the version string specfied by InstalledVersion to the version specified by MinimumVersion and optionally, MaximumVersion. If InstalledVersion lies between these two versions, then the property specified by the Property is set.

Parameters:
InstalledVersion version to compare
MinimumVersion mimumum allowed version
MaximumVersion optional paramater specifying the maximum version allowed
Property property to set if the version check passes

This is a table-driven custom action. It requires the following artifacts:

  1. A custom table called CompareVersions.
        <CustomTable Id="CompareVersions">
         <Column Id="Id" PrimaryKey="yes" Type="string" />
         <Column Id="InstalledVersion" Type="string" />
         <Column Id="MinimumVersion" Type="string" />
         <Column Id="MaximumVersion" Type="string" />
         <Column Id="Property" Type="string" />
        </CustomTable>
    
  2. An immediate CompareVersions custom action.
         <CustomAction Id="CompareVersions" BinaryKey="SystemTools" DllEntry="CompareVersions" Execute="immediate" Return="check" />
    
  3. An execution sequence that schedules the above custom actions before LaunchConditions.
        <InstallExecuteSequence>
         <Custom Action="CompareVersions" Before="LaunchConditions" Overridable="yes" />
        </InstallExecuteSequence>
        <InstallUISequence>
         <Custom Action="CompareVersions" Before="LaunchConditions" Overridable="yes" />
        </InstallUISequence>
    


© Application Security Inc. - All Rights Reserved http://msiext.codeplex.com