I want to create an MSI in WiX such that it can take a command line parameter to indicate whether it is a per-machine or per-user installation and consequently whether to raise a UAC dialog.
What is the best way to accomplish this?
I want to create an MSI in WiX such that it can take a command line parameter to indicate whether it is a per-machine or per-user installation and consequently whether to raise a UAC dialog.
What is the best way to accomplish this?
This is the link for per-machine/per-user from MSDN.
so to change the values from the command line parameter, you'll need something like so:
msiexec /i myinstaller.msi ALLUSERS=[1|2]
Also, have a look at this link from wix-users
The UAC dialog is controlled by a bit in the SummaryInformation stream. That, unfortunately, means it cannot be controlled at "run time" (install/repair/uninstall). You have to build different MSI files to truly change the UAC prompt.
I haven't been able to test in Vista yet, but what works in XP for limited user per user install and admin user per machine install is the following:
msiexec /i myinstaller.msi ALLUSERS="" INSTALLDIR="C:\Documents and Settings[Username]\Local Settings\Application Data\My COmpany\My Program"
The INSTALLDIR can be anything that a limited user can write to. The above is the directory Google Chrome uses. Found from the following link that the ALLUSERS property can actually be blank which is distint from 1 or 2 and that correctly sets the ProgramDir and Desktop locations
http://blogs.msdn.com/astebner/archive/2007/11/18/6385121.aspx