This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Automatic Per-User / Per-Machine Selection When Upgrading
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Apr 20, 2012
10:50 PM
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.
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.
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Apr 25, 2012
06:54 AM
you can find some information on how to get the details of installation context then rest is left to you..
![](/skins/images/8C9D13A71C7F7695F3262372C0172D68/responsive_peak/images/icon_anonymous_message.png)