How to check the installed package in WiX 3.0?

I would like to verify that Crystal Reports Basic for Visual Studio 2008 is installed as a condition for my own installation package.

I found this in the bootstrapper description for this product (C: \ Program Files \ Microsoft SDK \ Windows \ v6.0A \ Bootstrapper \ Packages \ CrystalReports10_5 \ product.xml):

<InstallChecks>
  <MsiProductCheck Property="CRVSInstalled" Product="{AA467959-A1D6-4F45-90CD-11DC57733F32}"/>
  <MsiProductCheck Property="CRVSRunTimex86Installed" Product="{CE26F10F-C80F-4377-908B-1B7882AE2CE3}"/>
  <MsiProductCheck Property="CRVSRunTimex64Installed" Product="{2BFA9B05-7418-4EDE-A6FC-620427BAAAA3}. "/>
</InstallChecks>

Trying to simulate this behavior on WiX, I did the following:

<Property Id="CRVSINSTALLED">
  <ComponentSearch Id="CRVSInstalledSearch" Guid="{AA467959-A1D6-4F45-90CD-11DC57733F32}" />
</Property>
<Property Id="CRVSRUNTIMEX86INSTALLED">
  <ComponentSearch Id="CRVSRunTimex86InstalledSearch" Guid="{CE26F10F-C80F-4377-908B-1B7882AE2CE3}" />
</Property>
<Property Id="CRVSRUNTIMEX64INSTALLED">
  <ComponentSearch Id="CRVSRunTimex64InstalledSearch" Guid="{2BFA9B05-7418-4EDE-A6FC-620427BAAAA3}" />
</Property>
<Condition Message="!(loc.CrystalReportsRequired)">Installed OR CRVSINSTALLED OR CRVSRUNTIMEX86INSTALLED OR CRVSRUNTIMEX64INSTALLED</Condition>

But it seems that it is ComponentSearchlooking for package components (files, directories) that have their own identifiers, and not looking for the package itself.

So how can I do this?

+5
source share
3 answers

As suggested here :

HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\ {productcode}. HKCU, , .

:

<Property Id="CRVSINSTALLED">
  <RegistrySearch Id="CRVSInstalledSearch" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\{AA467959-A1D6-4F45-90CD-11DC57733F32}" Name="InstallDate" Type="raw" />
</Property>
<Property Id="CRVSRUNTIMEINSTALLED">
  <RegistrySearch Id="CRVSRunTimeInstalledSearch" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\{CE26F10F-C80F-4377-908B-1B7882AE2CE3}" Name="InstallDate" Type="raw" />
</Property>
<Property Id="CRVSRUNTIMEINSTALLED">
  <RegistrySearch Id="CRVSRunTimeInstalledSearch" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\{2BFA9B05-7418-4EDE-A6FC-620427BAAAA3}" Name="InstallDate" Type="raw" />
</Property>
+3

<Upgrade Id="36E76465-5548-390F-955A-2776582C6A6C">
  <UpgradeVersion OnlyDetect="yes" Property="TFSCLIENT" Minimum="11.0.50727" />
</Upgrade>
<Condition Message="ERROR: Team Explorer for Microsoft Visual Studio 2012 is not installed">
  Installed OR TFSCLIENT
</Condition>

- ( Id ). MSI, Orca. - .

+2

API- Windows MsiQueryProductState msi.dll . , , . C:\Program Files\Windows Installer XML v3\SDK .

+1
source

All Articles