Using WiX 3.8
. Is it possible to create one MSI that allows for both per-user and per-machine installations? I want my installer to detect if elevation is required, preferably after the user has selected the installation directory.
These are my requirements:
- Support for Windows 7 or later.
- One MSI for both per-user and per-machine installations.
- No Setup.exe (bootstrapper).
- No elevation prompt if not required. E.g. Installing to
%LOCALAPPDATA%
. - Elevation prompt shown if required. E.g. Installing to
%PROGRAMFILES%
.
A possible compromise would be to skip the 5th requirement and call for explicit elevation before the Setup is started, but I really want to avoid such hassle.
So far, I have this:
<Package InstallerVersion="405"
InstallPrivileges="limited"
InstallScope="perUser" AdminImage="no" ... />
<Condition Message="Setting the ALLUSERS property is not allowed...">
Installed OR (NOT ALLUSERS)
</Condition>
All KeyPath
entries are mapped to HKMU
.
Can this be done?
I have googled this several times and have not been able to find a complete answer. Can the above be accomplished? WiX
gurus, please help!