Installation change do not ask for UAC permissions
Asked Answered
K

1

5

I implemented an installer for our product. Installer needs administrator privileges, so I used setup bootstrapper with a manifest file (as recommended here) to get these privileges on a Windows machines with UAC enabled. Installation and uninstall goes fine - the user is asked for permission and the installer does what it needs to do.

But if you run Control panelPrograms and Features and select "Change"* for installed program, an error occurs (custom, from installer LaunchConditions), telling that the installer needs administrative privileges. And I can't find any way to ask for permission in a such case - Windows simply runs the MSI file and doesn't know anything about required permissions.

Even more strange is the repair functionality - it asks for permission, but then fails to do some actions that were allowed during installation, using SetupBootstrapper.

I found a similar problem here:

But the proposed solutions are unacceptable in our case.

The only workaround for the change functionality now is to always use SetupBootstrapper and do not use the Programs and Features menu, but that is not very user-friendly and forces the user to keep the installer on his/her hard drive.

Has anybody better advise?

PS: I use WiX for creating the installer, so it would be great to hear about WiX solutions, but I'm pretty sure that it doesn't depend on the installer creation language, but only on MSI specifics.

Kilimanjaro answered 27/12, 2011 at 17:55 Comment(0)
M
4

What actions are failing? If they are actions that you added to the installation, make sure that such actions are defined with Impersonate="no" and Execute="deferred" (or "commit" or "rollback") and that they are sequenced somewhere between InstallInitialize and InstallFinalize.

Medeah answered 28/12, 2011 at 15:2 Comment(5)
Installation needs administrative permissions. And not actions but launchConditions are failing - installer doesn't get that permissions if running through Programs and FeaturesKilimanjaro
Okay, so what's the condition that fails in this scenario? Why can't you change it? Microsoft clearly thought that Privileged should almost always be true on a system with UAC.Medeah
The condition checks Privileged property. Of course I can change it, but it is not a fix to the problem - it simply will create another issues. The source of the question is that msi runs as NOT Privileged if not to use manifest file and bootstrapper. And It is impossible to use them through Programs and Features>Change/Repair menus.Kilimanjaro
Now I understand your answer is what I really needed to do =). Thanks. But at that time it didn't look clear enough why is it so.Kilimanjaro
Windows installer is complex enough to fool even the best of us. Glad it ended up working in the end!Medeah

© 2022 - 2024 — McMap. All rights reserved.