Archive: Problem with UAC.U.Elevate.AdminOnly


Problem with UAC.U.Elevate.AdminOnly
I am having a problem with the UAC plug-in on the uninstaller side only.

For the installer it works great, pops-up a UAC prompt, goes through the install, and creates all necessary shortcuts, files, etc.

For the uninstaller it also pops-up a UAC prompt, but when you click uninstall it says completed yet nothing gets removed. Even the details tab on the uninstaller only shows the word Completed.

Unfortunately I do have to use the UAC plug-in for this installer, as the installer is getting launched from a user level process and needs to be elevated.

Obviously if I could easily have different requestExecutionLevels between the installer and uninstaller this problem would be solved.

Thanks guys!


How is this a UAC plugin problem, if it is able to start the uninstaller elevated, what is the problem?


The problem is that it isn't uninstalling anything, it's just a dummy uninstaller.

If I build this same installer without using the UAC plug-in, setting the RequestExecutionLevel to admin, both the installer and the uninstaller work properly.

The problem is I need the installer to be set at the user level and then request a higher privilege for a specific purpose (I'm packing it inside and xpi file for firefox).

If I use the xpi with the packaged installer's RequestExecutionLevel set to admin, Vista with UAC turned on does not show a UAC prompt and the installer does not get launched.

If I use the xpi with the packaged installer's RequestExecutionLevel set to user, elevating the process with the UAC plug-in, installation from firefox works great, but the uninstaller no longer works, even though I still receive the UAC prompt.


Can you verify with Process Explorer if the uninstaller after you have elevated with the UAC dialog if the uninstaller is running with High IL (you must add the Integrity level column in process explorer probably) If it does not run @ High IL, create a minimal example and I will take a look at it


It's not running at high, but medium.

I'm not sure how easily I can post an example, but I will try. If there are any programatical implementations you might think I could look at, that might be easier.

Here is the screen shot.


looks like its running @ High IL to me, remember with the UAC plugin you have two instances of the same exe, the child process would be the elevated one, in that screenshot, you are not running process explorer elevated, but you can see that the inner most process does not have a IL since PE can't access the process, so it probably IS running elevated


So were does that leave me?

The installer and uninstaller works if I uncomment all references to the UAC plug-in:

# Top of .onInit
#${UAC.I.Elevate.AdminOnly}

# Top of un.onInit
#${UAC.U.Elevate.AdminOnly} "${UNINSTALLER_NAME}"

# inside nsi file
#${UAC.AutoCodeUnload} 1

and add:

RequestExececutionLevel admin

If I add them and set the requestEcecutionLevel to user, the installer works, but the uninstaller doesn't.


what does not work ? If the problem is deleting registry and/or files, Process Monitor could give you more info


the uninstaller doesn't delete anything that was installed; shortcuts, binaries, reg keys.

I ran process explorer as admin yet it said the process was high. Could it be that the uninstaller isn't signed?


The lack of signing must be the problem.

Both processes launch with the same priority, yet the installer is allowed to write and execute, but the uninstaller is not.

I've attached the screenshots below.


So I tried the example included with the plug-in, UAC_RealWorldFullyLoadedDualMode.

I installed for all users, it worked, like mine.

I ran the uninstaller, but it only deletes the install directory and registry, no shortcuts or start menu items.

I've attached a screenshot below.

Is this expected?


Well its running as admin, not sure what else you want me to do. The example code could have problems, I don't have Vista to test on so I don't know. For a quick fix, create a seperate uninstaller with RequestExecutionLevel admin and include that instead of calling WriteUninstaller in your script


Hey, I appreciate all your help on this issue.

Just to clarify I'm not asking you to do anything, just trying to post my experiences on this issue. Your feedback has helped me eliminate possible problems.

If someone else in the future has a similar problem, please reply to this thread so we can find out more about it.

Since, I only need the UAC plug-in for the xpi packaged version of the installer, I'm just going to pop a message up if a user is not admin and has UAC enabled, telling them to run as administrator (the uninstaller works if I remove the UAC.U.Elevate.AdminOnly in un.onInit and call RunAs directly from windows).

Thanks again!