windows-installeruacmsp

Custom action in a msp fails to add to registry (UAC restricts executions of some parts of custom action)


I have an issue with msp (Microsoft Patch) creation for Windows 8.

Executing my msp fails to add to the registry on some machines. If the msp is "run as admin" all is fine. But adding "run as admin" to .msp extension is not trivial & is not accepted as a solution.

The core issue is that this msp has a custom action (an exe) which adds some key/values to the registry. UAC avoids this custom action to execute at system/admin privileges. Actually the exe executes but only some parts of the exe (like updating registries) do not work (UAC at its best)!

How can I elevate the custom action execution privileges? I am using the basic msimsp to create the patch. I use orca to modify msi/msp.

Thanks.


Solution

  • This isn't a problem with UAC, this is a problem with poor installation authoring. If you used the Registry table you wouldn't have this problem.

    Custom actions must be scheduled in the install execute sequence between InstallInitialize and InstallFinalize with the options of Deferred in the System Context (No Impersonation ) to be properly elevated.

    This was true ever since Windows 2000 if the installation was tested in the advertise as administration ( /jm ) and installed by a non-priviledged user ( /i ). It's just no one bothered to test these stories until UAC came along and enforced the pattern by giving administrators a standard user token.