Possible Duplicate:
Wix - change the installation folder based on privilege
Well this question arised when I was trying to solve my problem in How do I get different registry keys for allusers and single user.
Basically what I'm trying to do is:
if ALLUSERS=1 then
set InstallDir to Property1
else
set InstallDir to Property2
Anyone know to do this?
Ok, just finished. My wxs looks like:
<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>
Thanks @shambulator for the link. Note that I use After="AppSearch"
instead of Before="CostFinalize"
because that will make action executing right after registry search.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With