Microsoft KB Archive/305574

= How To Run a Custom Action with Local System Permissions in an .msi Package =

Article ID: 305574

Article Last Modified on 7/13/2004

-

APPLIES TO


 * Microsoft Windows Installer 1.1
 * Microsoft Windows Installer 1.2
 * Microsoft Windows Installer 2.0

-



This article was previously published under Q305574



SUMMARY
This article describes how you can use the MsidbTypeNoImpersonate flag to run a custom action with the local system permissions context.



MORE INFORMATION
If it is necessary to run your custom action when using the local system security context, set the attributes of the custom action in the CustomAction table to either 3072 (msidbCustomAction TypeInScript + msidbCustomAction TypeNoImpersonate) or 3328 (msidbCustomAction TypeInScript + msidbCustomAction TypeNoImpersonate + msidbCustomAction TypeRollback).

The custom action will not run with elevated privileges if the user who is running the application is not an administrator on the local computer and the Windows Installer package (.msi) is not managed. The only way for a custom action to be run with elevated privileges for a nonadministrator is to set the AlwaysInstallElevated policy for both the user and the computer.

