4

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.

Community
  • 1
  • 1
Sasha
  • 7,731
  • 4
  • 41
  • 72

1 Answers1

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.

Michael Urman
  • 15,286
  • 2
  • 24
  • 41
  • Installation needs administrative permissions. And not actions but launchConditions are failing - installer doesn't get that permissions if running through Programs and Features – Sasha Dec 28 '11 at 15:36
  • 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. – Michael Urman Dec 28 '11 at 22:40
  • 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. – Sasha Dec 29 '11 at 11:14
  • 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. – Sasha Aug 28 '12 at 10:13
  • Windows installer is complex enough to fool even the best of us. Glad it ended up working in the end! – Michael Urman Aug 28 '12 at 11:58