Automatic account creation is now enabled. Captcha authentication required for account creation and editing unless you are trusted here.

Install Per User or for All Users

From WiX Wiki at MindCapers

Jump to: navigation, search

You can't write to every user's profile. You can however write to the AllUsers profile and all users will inherit that if you create a per-machine install (see the ALLUSERS Property in the MSI SDK).

---

I read this:

http://msdn2.microsoft.com/en-us/library/aa371865.aspx

(It took a while to get over the urge to slaughter those responsible... but I'm feeling much better now.)

That article indicates that Windows Installer is broken for per-machine installs as there is no way to specify that you must have a per-machine install that works on both XP and Vista.

If ALLUSERS=2, Vista will try a per-machine install and fail if the user's credentials do not allow it. But XP will perform a per-user install if ALLUSERS=2

If ALLUSERS=1 it appears that XP will do a per-machine install, though it is not documented as doing so on the page referenced above.

My ultimate goal is to install the application to a single common location that is user-independent. My current installer which only sets ALLUSERS=1 tends to scatter files all over the place on Vista as Vista has buggered the folder structure so some of my files appear to be in a "common" place that is only common for that one user (which appears to break component rules if another user installs the same stuff), and some files go elsewhere.

I'm hoping there is some conditional stuff I can add to the WiX source that will cause ALLUSERS to get set to the appropriate value (1 or 2) based on the OS and that this will happen in time for Windows Installer to recognize the value I want.

I also noticed that the documentation for the Directory Id "ProgramFiles" here http://msdn2.microsoft.com/en-us/library/aa370810.aspx indicates that it is always a per-user location. That's obviously not true on XP, but sadly it seems to be true on Vista.

What's the trick? ---

> That article indicates that Windows Installer is broken for > per-machine installs as there is no way to specify that you must have > a per-machine install that works on both XP and Vista.

ALLUSERS=1 does that. Pretend ALLUSERS=2 doesn't exist.

---

I sucessfully did a per-machine installer that works on XP and on Vista (at least on the tests in the virtual machines worked fine).

I use the ALLUSERS=2 option to make vista put the shortcuts on all the users desktop and start menu, but the secret is to include a bootstrapper. I use the GenerateBootStrapper task of msbuild.

When the user install the application he has to call the setup.exe instead of the msi and if he is using a limited account it ask for the password and everything works.

--- > For some reason my installation currently requires administrative > priviledges. I want to pull that down to standard user. Are there any > checks I should be doing? I want to find out what is forcing my > installation to ask for admin.

Your setup can't touch any per-machine location (ProgramFilesFolder, HKLM, etc.). On Vista, you need to explicitly mark a package as per-user (Package/@InstallPrivileges).

Personal tools