gpt4 book ai didi

WiX - 如何有条件地设置属性

转载 作者:行者123 更新时间:2023-12-02 11:51:57 26 4
gpt4 key购买 nike

Possible Duplicate:
Wix - change the installation folder based on privilege

当我试图解决 How do I get different registry keys for allusers and single user 中的问题时,出现了这个问题。 .

基本上我想做的是:

if ALLUSERS=1 then
set InstallDir to Property1
else
set InstallDir to Property2

有人知道怎么做吗?

最佳答案

好的,刚刚完成。我的 wxs 看起来像:

<CustomAction Id="PerUserInstall"    Property="InstallDir" Value="[INSTALLDIR1]" Execute="immediate" />
<CustomAction Id="PerMachineInstall" Property="InstallDir" Value="[INSTALLDIR2]" Execute="immediate" />
<InstallExecuteSequence>
<Custom Action="PerUserInstall" After="AppSearch">ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))</Custom>
<Custom Action="PerMachineInstall" After="AppSearch">ALLUSERS=1 OR (ALLUSERS=2 AND Privileged)</Custom>
</InstallExecuteSequence>

感谢@shambulator 提供的链接。请注意,我使用 After="AppSearch" 而不是 Before="CostFinalize" 因为这将使操作在注册表搜索后立即执行。

关于WiX - 如何有条件地设置属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11947335/

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