gpt4 book ai didi

wix - 如何在WiX 3.0中检查已安装的软件包?

转载 作者:行者123 更新时间:2023-12-04 18:54:43 26 4
gpt4 key购买 nike

我想检查是否已将Visual Studio 2008的Crystal Reports Basic安装为我自己的安装包的条件。

我在此产品的 bootstrap 描述中找到了此文件(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中的这种行为,我做了以下工作:
<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的软件包组件(文件,目录),而不是在寻找软件包本身。

那么我该怎么做呢?

最佳答案

如建议的here:

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 - 如何在WiX 3.0中检查已安装的软件包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/851677/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com