This project is read-only.

ServiceCredDlg and UAC


ServiceCredDlg requires user to check the Test / Verify button before he can click Next to proceed to the next screen. When the button is clicked a custom action is used to verify that the specified account indeed has the rights to logon as service. This custom action requires the MSI to run in the elevated mode. However, when the msi is started directly, not from an elevated command prompt nor from a bootstrapper that does elevation early in the sequence, the UI sequence of the MSI and the custom action end up running in non-elevated mode. This makes the custom action and the entire installation to fail.


dblock wrote Sep 29, 2010 at 12:55 AM

Typically people bootstrap installers that do this and embed a UAC manifest (eg. with

rprimrose wrote Jun 28, 2011 at 3:02 AM

Is there anyway around this? Is there no way of getting the msi to elevate earlier? Ideally I only want the MSI file rather than for people to download a set of files to install and everyone just hits the msi directly.

dblock wrote Jun 28, 2011 at 4:10 AM

I don't think there's a way around this without a bootstrapper.

zvolkov wrote Jun 28, 2011 at 12:41 PM

I don't see why MSI can't elevate mid-sequence? Can't there be a custom action developed, something like "request elevate unless already so"...

rprimrose wrote Jun 28, 2011 at 2:09 PM

I've been doing some research into this issue tonight. The problem is that custom actions in the UI sequence do not run under UAC unless the MSI was executed as elevated.

I guess one question here is whether it is possible for the custom action to elevate. At the very least the custom action should be aware that it cannot run without elevation. An alternative to this is to modify the dialog so that the Verify button is disabled if the MSIUSEREALADMINDETECTION property is set.

rprimrose wrote Jul 25, 2011 at 2:04 AM

FYI, I have created a VS project template that will create a simple bootstrapper for a WiX project or any MSI output. DotNetInstaller looks like a great product, but way to complex when elevation is your only bootstrapper requirement. You can get the project template from the Visual Studio Galleryy at