Can I install in Program Files with limited privileges?

I have an application that will be deployed as an MSI package (created on WiX).

I decide whether to specify elevated or limited privileges required by the installer.

The application does not contain anything that requires elevated privileges, except for the default installation location, which is located in the "Program Files" section.

Now the problem is:

  • If I specify elevated privileges , the user asks for UAC for the administrator password during installation. This is not required and prevents the installation of non-admin users.

  • If I specify limited privileges , then the user will be presented with a dialog box for choosing the installation location with Program Files by default. If they do not change the installation location (95% of the end users probably will not), then the installer will complete with a message that he must contact the administrator or run the application as administrator. If they run the installer as an administrator, then they can easily install them in Program Files, but most users probably do not know how to run the installer as an administrator.

I can potentially set the default installation location, for example, C: \ Company name \ Program \, but it seems to me non-standard, and most users will not like it (they are probably used for installation in Program Files).

How do you solve this problem when installing applications under limited user accounts?

+7
installer windows-installer uac privileges
source share
3 answers

The alternate location that you offer directly on the C drive will most likely also require elevated privileges. Before Windows 7, I would suggest using an early custom action to change the default location for limited installations. Change the Privileged property (or possibly AdminUser ), check if you need to install MSIUSEREALADMINDETECTION for your case and use something like [LocalAppDataFolder]Company\Product . Unfortunately, this approach will lead to the creation of a package that is difficult to install for all users, since you must first pick it up, and in a limited case, they can still choose a target location that needs to be upgraded. They must be pre-lifted because the package must be marked so as not to be lifted.

If you can focus only on Windows 7 and later, you can conditionally set MSIINSTALLPERUSER to redefine the installation location and height requirements, and instead install it for each user. In this case, the user may be asked to install for all users (requires promotion) or only for himself. A package can be marked for promotion, and installing MSIINSTALLPERUSER override this and skip the UAC prompt.

+6
source share

Most likely, your software works with the usual user privileges, which I already mentioned, this is not a problem.

There is nothing wrong with asking for administrator privileges to install something.

Either the user himself will have the details, since they use a limited account for security reasons or the software will be installed by their IT department in any case.

+3
source share

Run the command prompt (cmd) as an administrator.

Then use the msiexec command to run the msi file.

-2
source share

All Articles