benhinman
Posts: 37
Joined: Wed Aug 06, 2008 7:50 am

Run as administrator.

Hi,

Looking to run a file as administrator - thus using the "RunAsAdmin" predefined UI custom action setting the RunAsAdminFile in the process.

All works fine on a Windows 7 machine but Windows 2003 or similar (i.e. pre-Vista) doesn't seem to do anything...

Thanks,
Ben
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Run as administrator.

Hello,

I have tested the Launch File as Administrator UI predefined custom action on both Win Server 2003 and Win XP and everything is working as expected. I am suspecting that something inside your application may be the cause of this behavior. Please look more into the issue from this point of view.

If you cannot fix this please send us the .AIP (project) and a verbose log of the installation to support at advancedinstaller dot com so we can help you investigate.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Run as administrator.

Hello Ben,

I could indeed reproduce the behavior. I reported it and we are currently investigating the issue.

Meanwhile, you can run a .bat as administrator in a different way. Please follow this thread to find out how.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
benhinman
Posts: 37
Joined: Wed Aug 06, 2008 7:50 am

Re: Run as administrator.

Thanks for getting back to me.

The problem with the solution in the linked thread is that if you require elevated permissions (as you would if UAC is turned on on Vista+) the batch file will fail.

My solution for now is:

I condition 2 custom actions on the VersionNT property. The first called LaunchServices based on "Launch file or open URL". The second called LaunchServicesUAC based on "Launch file as administrator".

Thanks for the help - let me know when a fix is available!

Thanks,
Ben
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Run as administrator.

Hello Ben,

Yes you are correct. For know, the workaround you mentioned in your last post is optimal in the case of a BAT file.
Thank you for bringing this to our attention.

Best Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”