Run as Administrator Bug? - Advanced Installer Community
codesynergy
Posts: 100
Joined: Fri Nov 14, 2014 10:29 pm

Run as Administrator Bug?

Hi.

I'm not sure if this is a bug or not, but it tripped me up a bit. I was trying the batch file regsvr32 code as described by Daniel here: http://www.advancedinstaller.com/forums ... 8&start=30

I used the "LaunchFile" custom action (deferred) to launch a batch file that runs regsvr32 MyDll.dll. I noticed the following:

(In all cases, I set the "Working directory" to [APPDIR])

“Run as Administrator” AND “Run under the LocalSystem account with full privileges (no impersonation)”:
Success. Working directory correctly set.

NOT “Run as Administrator” AND “Run under the LocalSystem account with full privileges (no impersonation)”:
Success. Working directory correctly set.

NOT “Run as Administrator” AND NOT “Run under the LocalSystem account with full privileges (no impersonation)”:
Failure. Working directory correctly set.

“Run as Administrator” AND NOT “Run under the LocalSystem account with full privileges (no impersonation)”:
Failure. An additional UAC prompt is displayed. The working directory is not set.


It sounds like the first three scenarios are working as expected. The fourth scenario seems strange:
  • Is another UAC prompt expected here?
  • After acknowledging the UAC prompt, the registration fails.
  • The working directory is not being set to APPDIR.
Again, I'm not sure if this is a bug. But, I thought I would post just in case. I just run with “Run under the LocalSystem account with full privileges (no impersonation)” checked, and everything works fine.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Run as Administrator Bug?

Hi,
“Run as Administrator” AND NOT “Run under the LocalSystem account with full privileges (no impersonation)”:
Failure. An additional UAC prompt is displayed. The working directory is not set.
You can take a look on the Launch File Working Directory NOT WORKING! which debates the same problem.
Is another UAC prompt expected here?
The UAC can prompt again depending on where the custom action is placed. If it is placed on the "Install Execution Stage" section, it should inherit the permission from the installer and the UAC should not prompt again. I tested this and it worked as expected.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”