Batch file needs to be executed as "Administrator" - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

jmace
Posts: 55
Joined: Thu Jul 01, 2010 4:46 pm

Batch file needs to be executed as "Administrator"

I have a batch file that encrypts the connection strings in my web.config during the InstallFinalize state. On Windows 7 with UAC enabled, this file will not execute correctly. How can I execute this batch file as an administrator?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Batch file needs to be executed as "Administrator"

Hello,

To execute the custom action with elevated privileges, the custom action must be marked as "with no impersonation" from it's properties pane to the right.
"With no impersonation" custom actions run under the local SYSTEM account, thus with full privileges.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
jmace
Posts: 55
Joined: Thu Jul 01, 2010 4:46 pm

Re: Batch file needs to be executed as "Administrator"

When I drill into InstallFinalize --> viewer.exe, there is no option for the impersonation.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Batch file needs to be executed as "Administrator"

Hello,

Just place it under InstallIIS not under InstallFinalize. The 'with no impersonation' is available there.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
jmace
Posts: 55
Joined: Thu Jul 01, 2010 4:46 pm

Re: Batch file needs to be executed as "Administrator"

I got it. Thanks. I took your suggestion and moved action to the install state and was able to use the impersonate options.

Return to “Common Problems”