cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
repal_rahul
Level 3

LaunchAppAndWait() doesn't Work With Window 7.

Hi,

I have migrated project to IS 2011.

We are using LaunchAppAndWait (szCmdLine, "", bWait) function to launch EXE.

Here szCmdLine is "C:\Documents and Settings\Rahul\Desktop\redist\dotnetfx2.0.exe"/q:a /c:"install.exe/qb"

Does any body know why this function is not working with Window 7?
It works with Window XP.
Labels (1)
0 Kudos
(9) Replies
rrinblue22
Level 9

Are you trying to place this code in a custom action?

if yes, then try to set the in-script execution to deferred in system context.
this should elevate the process on Win 7.
0 Kudos
repal_rahul
Level 3

Thanks for the reply,

I have written this function in Setup.rul script file which IS calls.

This is not the custom action.

Do you have any info about LAAW_OPTION_USE_SHELLEXECUTE parameter?

I think by using that Parameter Install shield script engin will call ShellExecuteEx funciton. And that will support window 7.

Rahul
0 Kudos
rrinblue22
Level 9

Yeah, in this case you can use LAAW_OPTION_USE_SHELLEXECUTE

in LaunchApplication instead and have the LAAW_SHELLEXECUTEVERB = "runas".

This should elevate your process on Win 7.
0 Kudos
repal_rahul
Level 3

Hi Thanks again,

I was trying below function but it is not working as expected,
LaunchApplication(szCmdLine,"","",1000, LAAW_OPTION_WAIT | LAAW_OPTION_USE_SHELLEXECUTE)

Do you have any working code for this function LaunchApplication()?
0 Kudos
rrinblue22
Level 9

I have sent you a generic code which I use.

hope that helps you.
0 Kudos
Roman1
Level 9

Hello rrinblue22,

could you post it for all, please?

Thanks
0 Kudos
rrinblue22
Level 9

Hello Roman,

below is the piece of code i use to elevate an install on Vista/Win 7 etc


*************************************
function OnBegin()

STRING szProgram,szCmdLine,szDirectory;
NUMBER nShowWindow,nTimeOut,nOptions;


begin

szProgram = SUPPORTDIR ^ "setup.exe";
szCmdLine = "" ;
szDirectory = "";
nShowWindow = SW_NORMAL;
nTimeOut = 10000;
nOptions = LAAW_OPTION_USE_SHELLEXECUTE ;
//This ensures that the application is always run with full administrator privileges
LAAW_SHELLEXECUTEVERB = "runas";

//A message box just for internal testing
MessageBox("Click ok to Launch",INFORMATION);

// launch application--setup.exe in this case
LaunchApplication(szProgram,szCmdLine,szDirectory,nShowWindow,nTimeOut,nOptions );

end;
*****************************

hey Rahul, I have modified the code a bit.......
0 Kudos
Roman1
Level 9

Hello rrinblue22,

thanks for the code.

Does the
"function OnBegin()"

wait until the extern setup ends?
0 Kudos
rrinblue22
Level 9

Hey Roman,

If you want OnBegin() to wait then you may need to consider using the
nOptions = LAAW_OPTION_WAIT|LAAW_OPTION_USE_SHELLEXECUTE ;
in the sample script.

this would wait for the external application to complete/abort.
0 Kudos