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
FOLLOW US
Get the latest news in Application Packaging