[wix-users] Obtaining version for already installed 3rd party program

Bevan Weiss bevan.weiss at gmail.com
Wed Mar 21 01:50:52 PDT 2018


 Hi all,

I'm sure this will be an easy one for someone, but my google-foo is failing
me.

I'm trying to obtain the string which represents the currently installed
version of an application (which is not 'my application', but a 3rd party
application on which my application is based).

Currently I have the following:
<Upgrade Id="{6D991503-3102-437E-B21D-471599D491AB}">
   <UpgradeVersion Minimum="0.0.0.0" OnlyDetect="yes"
Property="CLEARSCADADETECTED" />
</Upgrade>

<Property Id="CLEARSCADA_VER" >
  <RegistrySearch Id="ClearSCADAVersionSearch"
                      Root="HKLM"
                      Key="SOFTWARE\Microsoft\Windows\Current
Version\Uninstall\[CLEARSCADADETECTED]"
                      Name="DisplayVersion"
                      Type="raw"
                      Win64="yes"/>
</Property>

However I'm not seeing any version string in the CLEARSCADA_VER property.
I do have the following entries in the install log however
MSI (c) (4C:98) [15:39:19:621]: Note: 1: 2262 2: Signature 3: -2147287038
AppSearch: Property: CLEARSCADA_VER, Signature: ClearSCADAVersionSearch
MSI (c) (4C:98) [15:39:19:621]: Note: 1: 2262 2: Signature 3: -2147287038
MSI (c) (4C:98) [15:39:19:621]: Note: 1: 1402 2:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current
Version\Uninstall\{2ACE38B2-F142-4EFE-9AC7-B25514E4930E} 3: 2
Action ended 15:39:19: AppSearch. Return value 1.

MSI (s) (88:84) [15:39:23:978]: Note: 1: 2262 2: Signature 3: -2147287038
AppSearch: Property: CLEARSCADA_VER, Signature: ClearSCADAVersionSearch
MSI (s) (88:84) [15:39:23:978]: Note: 1: 2262 2: Signature 3: -2147287038
MSI (s) (88:84) [15:39:23:978]: Note: 1: 1402 2:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\ 3:
2
Action ended 15:39:23: AppSearch. Return value 1.
MSI (s) (88:84) [15:39:23:978]: Doing action: LaunchConditions

And this DisplayVersion certainly appears within the Registry (in the 64bit
'section')..
[IMAGE OF REGISTRY SHOWING VERSION REMOVED FOR SIZE LIMITS]

I have multiple versions of our 'driver' which are tied to a precise
version of the ClearSCADA application.  I'm dynamically building and
packaging multiple versions, but then need to at install time dynamically
condition the components against the appropriate version of the ClearSCADA
installed.
Which does bring me to problem 2.
Is there a 'WiX way' to dynamically add multiple ComponentGroupRefs under
an existing ComponentGroup?
  I have added in manually:
<!-- Installed stuff. Only an exe and a dll -->
<Feature Id="ProductFeature" Title="$(var.PRODUCT_NAME)" Level="1"
Description="$(var.PRODUCT_NAME)">
      <ComponentGroupRef Id="ProductComponents" />
      <ComponentRef Id="RegistryEntries" />
</Feature>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
      <ComponentGroupRef Id="ver_6.77.5882.1"/>
      <ComponentGroupRef Id="ver_6.78.6284.2"/>
      <ComponentGroupRef Id="ver_6.78.6626.1" />
</ComponentGroup>

But I really need the ComponentGroupRef entries to be dynamically added
based on my .wixproj MSBuild HeatDirectory 'stuff'.. which is generating
the .wxs files for the ver_6.77.5882.1.. etc componentgroups.

I haven't yet tried having a
<ComponentGroupRef Id=ProductComponents>
  <ComponentGroupRef Id="ver_6.xx.xxxx.x"/>
</ComponentGroupRef>
in each of the Heat generated wxs files... is there any chance this will
work? (I'll try tonight anyway).


Regards,

Bevan Weiss


More information about the wix-users mailing list