I'd like to check 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 SDKs\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 mimic this behavior in 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 ComponentSearch
is looking for package components (files, directories) that have their own ids, rather than looking for the package itself.
So how can I do this ?
As suggested here :
This goes like this :
You can use Upgrade table
Now the tricky bit is to find Upgrade Code (specified in Id attribute above). If you have an MSI package, just look at it by Orca. If you don't - try this solution.
The windows installer API has the
MsiQueryProductState
function inmsi.dll
to do this. Unfortunately you'll have to write a custom action to make use of this in your installer. The assemblies inC:\Program Files\Windows Installer XML v3\SDK
may make this easier.