如何在 WiX 3.0 中检查已安装的软件包? [英] How to check for installed package in WiX 3.0?

查看:28
本文介绍了如何在 WiX 3.0 中检查已安装的软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检查是否安装了用于 Visual Studio 2008 的 Crystal Reports Basic 作为我自己的安装包的条件.

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

我在这个产品的引导程序描述中找到了这个 (C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\CrystalReports10_5\product.xml):

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>

尝试在 WiX 中模仿这种行为,我执行了以下操作:

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>

但似乎 ComponentSearch 正在寻找具有自己 id 的包组件(文件、目录),而不是寻找包本身.

But it seems that ComponentSearch is looking for package components (files, directories) that have their own ids, rather than looking for the package itself.

那我该怎么做?

推荐答案

建议 这里 :

尝试在 HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{productcode} 下进行注册表搜索.如果您的产品和依赖项都是基于用户的产品,还可以考虑在 HKCU 下进行搜索.

Try a registry search under HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{productcode}. Also consider a search under HKCU if both your product and the dependency are per-user products.

事情是这样的:

<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>

这篇关于如何在 WiX 3.0 中检查已安装的软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆