3

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:

  1. Support for Windows 7 or later.
  2. One MSI for both per-user and per-machine installations.
  3. No Setup.exe (bootstrapper).
  4. No elevation prompt if not required. E.g. Installing to %LOCALAPPDATA%.
  5. 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!

l33t
  • 18,692
  • 16
  • 103
  • 180

1 Answers1

1

Single Package Authoring is what MS call this. It should be possible in WiX, it's a Windows Installer thing.

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
PhilDW
  • 20,260
  • 1
  • 18
  • 28