cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Dean_Wittmann
Level 2

Automatic Per-User / Per-Machine Selection When Upgrading

For an initial install (InstallScript MSI), I give the user the option to install per-user or per-machine (all users).

When there is an upgrade, I would like to automatically detect that the upgrade should be per-user or per-machine, based on the original install option that the user chose. This is so that they don't have to choose again for the upgrade installation sequence.

Has anyone done this? And how?

My TARGETDIR for per-user is [AppDataFolder]CompanyName\ProductName, and TARGETDIR for per-machine is [ProgramFilesFolder]CompanyName\ProductName.

I could check to see if the [AppDataFolder]CompanyName\ProductName\Product.exe file exists (or other known file in this location), and if so, assume it is a per-user install. If not, then check to see if the [ProgramFilesFolder]CompanyName\ProductName\Product.exe file exists (or other known file in this location), and if so, assume it is a per-machine install. If neither exists, it is a new installation.

This presents problems when both exist and a non-admin user logs in as an admin and tries to do an upgrade. Which install will it upgrade by default?

Would this be the way to do it, or is there a more standard way?

I don't believe this is handled automatically without additional scripting, but I may be wrong.
Labels (1)
0 Kudos
(1) Reply
CHANDINATHREDDY
Level 7

you can find some information on how to get the details of installation context then rest is left to you..
0 Kudos