FindOcxVersion function

Find the product version of an ActiveX control (.ocx file) and store it in the indicated variable as a.b.c.d, suitable for version testing and general conditions. If the ActiveX control is not found or if it does not have an embedded version number, the variable is set to an empty string.

The FindOcxVersion function is a predefined extension DLL function that is distributed with InstallMate. You can use this function by adding a Run DLL action to the action sequence in which you want to run the action. Set the Run DLL action attributes as follows:

Arguments

The FindOcxVersion function expects the following arguments. All arguments may contain symbolic references; these will be resolved before the function is called. Note that you must "quote" an argument if it contains spaces, or if it could contain spaces after expansion of symbolic references.

clsid_progid
The CLSID or ProgID of the ActiveX control that you wish to interrogate. The function will treat the passed-in argument as a CLSID if it has the general GUID format {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} or as a ProgID if it has a ProgID format such as WhizBang.Control.1.
varname
The name of the variable to which to assign the version number of the ActiveX control's .ocx (or .dll) file, if found. If not found or if it the control's file does not have an embedded version number, the variable is set to an empty string.

Return value

Returns ERROR_SUCCESS (zero) if successful, else a nonzero error code. This error code is available in the LastExitCode variable. To find out if the version number was found, test the varname variable.

Remarks

To use this function, you must add the extension DLL to your InstallMate project. The easiest way to do so is as follows:

  1. Open your InstallMate project.
  2. Choose File > Import > Project Items... from the main menu bar.
  3. Browse for and select the file Insert Extension DLL.imq, then click Open.

Alternatively, you can go to the Installer options page in your InstallMate project, click on the Advanced... button, then click on the Extension DLL tab and enter the paths to the extension DLL versions there.