Custom Action with administrator privileges - 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!

DrEight
Posts: 6
Joined: Tue Jan 11, 2011 3:44 pm

Custom Action with administrator privileges

Hello,
I'm tring to execute netsh.exe inside a custom action.
I tried to create a .bat file with inside the command. ( the command looks like this : netsh http add urlacl url=http://+:1234/ServiceFunctions/ user=everyone )
I tried also to execute netsh as .exe passing the argument.
In both cases the action fails under Win 7 x64 and Vista x64

The help says to set the execution properties as : Deferred with no impersonation.
I did with no result. I also tried all other options without result.

What am I doing wrong ?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Custom Action with administrator privileges

Hi,

Running the custom actions as "Deferred with no impersonation" makes it run with full admin rights under the SYSTEM user account, this should work for you too.

Is this running correctly from the "cmd.exe" ?

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
DrEight
Posts: 6
Joined: Tue Jan 11, 2011 3:44 pm

Re: Custom Action with administrator privileges

Thank you for the response.
Yes the .bat runs correctly and also if I type the netsh command from a cmd with administrative rights everything is fine.
It seems that Advanced installer does not run the .bat. in vista64 and win7 64.
I just tried to create an simple .bat with inside only 'pause'. In winxp32 the cmd window pops up waiting for an input ( correct! ). The same .bat in a 64bit setup runs in vista64/ win7 64 does not work. The setup just says that an error occurred.

For information : I've created the custom action with the 'custom action wizard' and I have only changed the execute option to 'deferred with no impersonation'. The custom action is in Commit phase.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Custom Action with administrator privileges

Hello,

I am not sure why you are encountering this behavior.
Please send us the .AIP (project) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Custom Action with administrator privileges

Hello,

This problem appears because the path to which the reference [#httpcfg_win7.bat] is resolved contains spaces. The solution is to add quotes in the command line field so it looks like this:

Code: Select all

"[#httpcfg_win7.bat]"
Rebuild and test the package, everything should work correctly now.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”