cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
LKM_N4EN
Level 6

[URGENT] Unable to launch [ProductName] in Vista

My setup enable the launch application when installation completes. I change the default custom action from running a exe to run an installscript function. This setup is running with no problem in Windows 2000 and Windows XP when I check the checkbox of "Launch application" in the "SetupComplete Dialog".

However when I install the setup on Windows Vista, there is a dialog box display "Unable to launch [ProductName]".

Please help me to point out where's the problem.
Labels (1)
0 Kudos
(8) Replies
hidenori
Level 17

You may need to use the LaunchApplication InstallScript function in order to launch your application with elevated privileges.
0 Kudos
LKM_N4EN
Level 6

Yeah, I am using the installscript function.
LaunchApplication(szProgram, szCmdLine, szDirectory, SW_SHOWDEFAULT, nTimeOut, LAAW_OPTION_NOWAIT)

szProgram: path to java.exe
szCmdLine: parameter pass to launch the application
szDirectory: location of the jar files
nTimeOut: 100 (this could be ignore as I used the LAAW_OPTION_NOWAIT

I could launch my application in Windows 2000 and Windows XP, so I think it shouldn't be the problem of the command line. In Vista, sometimes the setup generated could launch it, but most of the time cannot.

Have a clue on it?
0 Kudos
LKM_N4EN
Level 6

Sorry that I forgot to mention, the dialog box display "Unable to launch [ProductName]" is because I catch the error and return to this messagebox "SEVERE" if the application could not be launch after calling the LaunchApplication function.
0 Kudos
Reddy611
Level 6

can u try writing vbscipt for launching the application after installing .
i think this is help full to u.
0 Kudos
DebbieL
Level 17

You might want to try also passing the LAAW_OPTION_USE_SHELLEXECUTE constant for the nOptions parameter of LaunchApplication. The link that Hidenori provided has more details about it.
0 Kudos
LKM_N4EN
Level 6

Thanks for all the replies.
I follow the suggestion to add the LAAW_OPTION_USE_SHELLEXECUTE in nOptions parameter. It seems no problem to launch my application in Vista now.

Could you please tell me why I have to use the shellexecute instead of createprocess?
0 Kudos
LKM_N4EN
Level 6

After the installation, I look into the log and found this:
MSI (c) (68:28) [10:58:19:681]: NOTE: custom action IS_LAUNCH_MY_PROGRAM_PLEASE unexpectedly closed the hInstall handle (type MSIHANDLE) provided to it. The custom action should be fixed to not close that handle.
Action ended 10:58:19: IS_LAUNCH_MY_PROGRAM_PLEASE. Return value 1.
MSI (c) (68:EC) [10:58:19:681]: Doing action: ShowMsiLog
Action 10:58:19: ShowMsiLog.
Action start 10:58:19: ShowMsiLog.
Action ended 10:58:19: SetupCompleteSuccess. Return value 2.
Action ended 10:58:19: INSTALL. Return value 1.
Action ended 10:58:19: ShowMsiLog. Return value 0.

I am worrying on the message in line 2 where the custom action unexpectedly closed the hInstall handle. I try to search for the fix, and I found this.

Also I wonder why the SetupCompleteSuccess return value 2.
0 Kudos
Jeff2008
Level 6

LKM_N4EN wrote:
Thanks for all the replies.
I follow the suggestion to add the LAAW_OPTION_USE_SHELLEXECUTE in nOptions parameter. It seems no problem to launch my application in Vista now.

Could you please tell me why I have to use the shellexecute instead of createprocess?


Must be because of: http://koobmeej.blogspot.com/2006/11/windows-vista-createprocess-issues.html
0 Kudos