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_INSTALLEDversion to compare
VERSION_MINIMUMmimumum allowed version
VERSION_MAXIMUMoptional paramater specifying the maximum version allowed
VERSION_PROPERTYproperty 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:
InstalledVersionversion to compare
MinimumVersionmimumum allowed version
MaximumVersionoptional paramater specifying the maximum version allowed
Propertyproperty 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