gpt4 book ai didi

WiX 和 ARPINSTALLLOCATION

转载 作者:行者123 更新时间:2023-12-04 19:48:13 33 4
gpt4 key购买 nike

我希望我的 MSI 包写入值 InstallLocation进入HKEY_LOCAL_MACHINE\SOFTWARE\\(Wow6432Node)\Microsoft\Windows\CurrentVersion\Uninstall\\(GUID) .您还应该在“添加/删除程序”控制面板(Location 列)中看到此值。

要通过 WiX 设置此值,我读到应该通过自定义操作设置属性 ARPINSTALLLOCATION。我减少了 <Product>到最低限度。这是它的样子:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="*"
Name="MyApplication"
Language="1033"
Version="!(bind.FileVersion.MyApplication.exe)"
Manufacturer="Me"
UpgradeCode="db37f5dc-68c5-46ee-bbdf-704ff68b70db">
<Package InstallerVersion="400" Compressed="yes" InstallScope="perMachine" Languages="0" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />

<!-- use SetProperty as suggested by Rolo -->
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize" />
<Feature Id="ProductFeature" Title="MyApplication" Level="1">
<ComponentGroupRef Id="MyApplication.Files.AllRequired" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="MyApplication" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="MyApplication.Files.AllRequired">
<Component Id="ProductComponent"
Guid="90EA8F1C-77D2-40E1-81AD-44B076EFAB9D"
Directory="INSTALLDIR">
<File Id="MyApplication.exe" Source="$(var.MyApplication.TargetDir)\MyApplication.exe" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

MSI 捆绑在 WiX 标准 Bootstrap 中。

最佳答案

您应该在两个序列(InstallExecuteSequence 和 InstallUISequence)中执行您的自定义操作,并在 CostFinalize 之后对其进行排序。

你可以使用类似这样的东西来简化它:

<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize" />

关于WiX 和 ARPINSTALLLOCATION,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27500705/

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