cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
FrankG2012
Level 4

execute a program from within installashield 2012 script running with elevated privil

Hi all,
In a Windows 7 environment,logon with User rights,i need to run a InstallScript Exe.
From within the installscript,i need to execute another .exe,using elevated privilege,and then i need to impersonate an administrator account for doing this.
There are examples or instructions to resolve this question?
Thanks to all in advance
Frank
Labels (1)
0 Kudos
(5) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

You can launch an EXE through ShellExecute (to perform a runas operation) using the InstallScript LaunchApplication function and passing LAAW_OPTION_USE_SHELLEXECUTE in the nOptions parameter (along with any other options needed). The shell execute verb to use is set through the LAAW_SHELLEXECUTEVERB variable (the default is runas).
0 Kudos
FrankG2012
Level 4

Thank you Josh Stechnij for your reply,but my problem is: i've logged with user privileges,and then when i launch application,i need to impersonificate a administrative account because i must write in to the windows registry.
Where i can set credentials of the admin account?
thanks in advance
Frank
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

With ShellExecute launching a new process (Vista and newer) with the runas verb, a UAC prompt will be displayed asking for consent to run the new process elevated. If the new process is being launched from an account with standard user privileges (a user that does not belong to the admin group), the UAC prompt will request credentials of a user on the machine that has administrator privileges.

If this behavior is insufficient for some reason, you may try requesting the credentials and then use an API such as CreateProcessWithLogonW (http://msdn.microsoft.com/en-us/library/windows/desktop/ms682431(v=vs.85).aspx) to launch the new process with the obtained credentials.
0 Kudos
FrankG2012
Level 4

Thanks for your reply Josh.
Using Createprocesswithlogonw with UAC set to on,i receive error:740.
If i set to off UAC ,it works fine
Best regards
Frank
0 Kudos
saipro10
Level 3

Hi,

I am using Installshield 2009. I want to create setup by using Basic MSI in such way that setup can run without admin rights.
Anybody knows how to do this,please respond as earliest possible.
0 Kudos