superfun
Posts: 4
Joined: Thu Jun 26, 2008 4:42 pm

Upgrade per-user or per-machine

Is there a way to author an installation so that it will upgrade per-user installation to another per-user installation and a per-machine installations to another per-machine installation? Basically, just detect what it's upgrading and use that setting? And if it's a fresh install then default to what I've set in Advanced Installer?

I am aware that you can't switch types during an upgrade.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Upgrade per-user or per-machine

Hi,

I'm afraid that Windows Installer does not offer a way of detecting if a package was installed per-user or per-machine. Therefore, I'm not sure if what you need can be done.

However, you can try this:
- on a per-user installation the registry entries are created in the HKEY_CURRENT_USER registry hive and on a per-machine installation the registry entries are created under HKEY_LOCAL_MACHINE
- in your package you can use a search to find one of the registry entries in the HKEY_LOCAL_MACHINE hive
- if the search doesn't find the registry entry (the property of the search is empty), then the old package was not installed per-machine (the new package should be installed per-user)
- in order to set the package to install per-user, you can set the ALLUSERS property to an empty value (for example you can set it to an undefined property)

This approach will set the package to install per-user or per-machine, depending on the registry entries in the old package.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”