PDA

View Full Version : LaunchAppAndWait issue



teognost
06-24-2004, 08:38 AM
I have a DS9->IScriptMSIProject.
I need to run a batch file (1.bat)which makes only a simple thing-it copies one file from a disk location to another one(it does other things more complicated but for simplicity I would take this example).
In 1.bat I have written only this:
copy /Y c:\temp\liffe.txt c:\temp\test

The IS code is :
szCommandLine = "";
if ( LaunchAppAndWait(WINDISK^"Temp\\1.bat",szCommandLine,LAAW_OPTION_WAIT) <0)then
MessageBox("Error while running 1.bat!",SEVERE);
endif;

I put this code in OnBegin\OnEnd and it works ok-I see the DOS window and the file is copied.
I have also a feature called DefaultFeature.
I put this code into its Installed Event
(export prototype DefaultFeature_Installed(); ).
In this case the batch file is not executed- I see the DOS window only in a flash and the file is not copied.
The conclusion I got-if I execute this code in an event related to a feature-it doesn't work.If I use this code elsewhere (OnBegin,OnEnd,etc)-it works.
I think this is quite strange and I would be very happy to find an explaination or a solution for this.
Now the workaround would be to move the code from Installed Event in OnEnd but I prefer not to do this.

burked
06-24-2004, 08:47 AM
the response i got from InstallShield is the MSI functions are run under the msiexec space which appears to have different authentication permissions on the system than the InstallShield engine does.

thanks

teognost
06-24-2004, 08:51 AM
Ok-then what I suppose to do in order to be able to launch my batch file from DefaultFeature_Installed ?

burked
06-24-2004, 08:53 AM
you can write an exe that will launch what you need to launch from a commandline or something like that