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

Deq*_*ing 6 wix

可能重复:
Wix - 根据权限更改安装文件夹

好吧,当我试图解决我的问题时出现了这个问题我如何为allusers和单个用户获得不同的注册表项.

基本上我要做的是:

if ALLUSERS=1 then
   set InstallDir to Property1
else 
   set InstallDir to Property2
Run Code Online (Sandbox Code Playgroud)

有人知道这样做吗?

Deq*_*ing 6

好的,刚刚完成.我的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>
Run Code Online (Sandbox Code Playgroud)

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