This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- kernel32.CreateProcessA on Server 2008 x64 with elivated privileges
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 02, 2009
10:14 AM
kernel32.CreateProcessA on Server 2008 x64 with elivated privileges
I am trying to use our function that is used to execute external applications such as cmd and some helper tools in a 64 bit environment. We seem to use shell32 to do this:
This code works when you dont need your privileges to get elivated (tested this outside of the install), but unfortunately one of my cmd files needs elivated privileges...
I think the reasoning behind using this code was that the LAAW functions / EXE CA's dont work properly for us in IS11 (now upgraded to IS2009).
SO, my question is - How do I pass the runas command to force this call to run as administrator?
kernel32.CreateProcessA(NULL, szProgram + " " + szCmdLine, NULL, NULL, TRUE, 0, NULL, NULL, &siData, &piData)
This code works when you dont need your privileges to get elivated (tested this outside of the install), but unfortunately one of my cmd files needs elivated privileges...
I think the reasoning behind using this code was that the LAAW functions / EXE CA's dont work properly for us in IS11 (now upgraded to IS2009).
SO, my question is - How do I pass the runas command to force this call to run as administrator?
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 02, 2009
11:33 AM
In order to elevate, you need to offer UI, generally in the form of a call to ShellExecute / ShellExecuteEx. LaunchApplication can do this with the LAAW_OPTION_USE_SHELLEXECUTE flag.