cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
selwynreynolds
Level 7

launchappandwait not working on vista

I have an IS2010 Installscript MSI project. I upgraded it from 2009 where it worked - on XP. i am now trying to run the install on Vista. I call LaunchAppAndWait on a file that is in the SUPPORT dir. The nLaunchResult code returned in LAAW_PARAMETERS is 2, which I think means File Not found. I am calling FindFile before calling LaunchAppAndWait and InstallShield finds the file. I did a test and used a program path to the same file that I had put in a folder on my computer. LaunchAppandWait worked with that path. Is there a problem using SUPPORTDIR on Vista?

Thank you.
Labels (1)
0 Kudos
5 Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Are you using SUPPORTDIR or MsiGetProperty(..., "SUPPORTDIR", ...)? It might be worth showing a message box with the command you are trying to launch, and seeing if it would work by hand while that message box is still up.
0 Kudos
selwynreynolds
Level 7

I am using SUPPORTDIR. I did display a message box with the program to be run - went to the temp folder created for the support files and double-clicked the file and it did start to execute.
Here is my code:

if(FindFile(SUPPORTDIR, "filetorun.exe", svResult = 0) then
szProgram = SUPPORTDIR ^ "filetorun.exe";
LongPathToQuote(szProgram, TRUE);
if(LaunchAppAndWait(szProgram, "", LAAW_OPTION_HIDDEN | WAIT) < 0) then
nError = LAAW_PARAMETERS.nLaunchResult;
endif;
else
MessageBox("Install file not found", SEVERE);
endif;

nError = 2 when I run this.
0 Kudos
mumbles
Level 7

Might be permission related.

Try this, instead of creating an MSI in the releases, create a setup.exe instead. On the vista machine, right click the setup.exe and say 'Run as administrator'. If it works that time, it may be a matter of how your script/custom action is running.

Btw, setup.exe method works when runnnig the custom action as deferred execution. Not deferred system execution.

I'm still waiting for my thread to be answered, but i had a similar question myself. This is the only workaround i've found.
0 Kudos
selwynreynolds
Level 7

thanks for your suggestion. I'm not actually using CA's. I'm doing all this from InstallScript - a function in a dialog rul file. But, you could be right about it being some vista permission thing trying to run it from within InstallShield. My project does build a setup.exe and not an msi file.

Thanks.
0 Kudos
selwynreynolds
Level 7

Another note: I just tried copying the file from the SUPPORTDIR to a folder under TARGETDIR and using that path in the LaunchAppAndWait call and it worked!So, it seems to not like runnning the exe from the SUPPORTDIR - any idea why? I'll have to write script to remove the file if I copy it to the TARGETDIR when the install is complete. I like using SUPPORTDIR because it ensures all temporary files are removed. :confused:
0 Kudos