Marek
Marek

Reputation: 10402

Is it possible to install into Program Files with limited privileges?

I have an application that will be deployed as MSI package (authored in WiX).

I am deciding whether to specify elevated or limited privileges as required for the installer.

The application does not include anything requiring elevated privileges besides the default install location, which is under Program Files.

Now the problem:

I can potentially set the default install location to e.g. C:\Company name\Program\, but this seems nonstandard to me and majority of users will not probably like this (they are probably used to installing into Program Files).

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

Upvotes: 7

Views: 3532

Answers (3)

ChrisF
ChrisF

Reputation: 137198

It's probably more important that your software runs with normal user privileges - which I see you've mentioned isn't an issue.

There's nothing wrong in asking for admin rights to install something.

Either, the user will have the details themselves as they are running a limited account for safety reasons or the software will be installed by their company's IT department anyway.

Upvotes: 3

Michael Urman
Michael Urman

Reputation: 15905

The alternate location you propose, directly off of the C Drive, is likely to also require elevated privileges. Before Windows 7, I would suggest using an early custom action to change your default location for limited installations. Condition it off of the Privileged (or possibly AdminUser) property, verify whether you need to set MSIUSEREALADMINDETECTION for your case, and use something like [LocalAppDataFolder]Company\Product. Unfortunately this approach will result in a package that is difficult to install for all users as you must pre-elevate, and in the limited case they could still select a target location that requires elevation. They must pre-elevate because the package must be marked to not elevate.

If you can target solely Windows 7 and later, you can conditionally set MSIINSTALLPERUSER to override the install location and the elevation requirement, and instead install per-user. In this scenario, the user could be asked whether to install for all users (requires elevation) or just for himself. The package can be marked for elevation, and setting MSIINSTALLPERUSER will override that and skip the UAC prompt.

Upvotes: 6

Sunil Agarwal
Sunil Agarwal

Reputation: 4277

Run command prompt(cmd) as administrator.

Then use msiexec command to execute msi file.

Upvotes: -2

Related Questions