ralphster
Level 6

LaunchAppAndWait

Jump to solution

I am using LaunchAppAndWait to kick off a batch file using cmd.exe. It works great, but how should my code handle the call if the batch file does not exist? Is there an installshield command which can first check for the existence of "MyBatchFile.bat"? If not, how can I get InstallShield to handle a non existent file in this situation? I would like to handle the error from InstallShield rather than just getting a dos error message.

 

 

#define PROGRAM "C:Windows\\System32\\cmd.exe"
if (LaunchAppAndWait (PROGRAM, "MyBatchFile.bat", nWait) < 0) then
MessageBox ("Unable to launch "+ PROGRAM +".",SEVERE);
endif;

Labels (1)
0 Kudos
2 Solutions
rguggisberg
Level 13

Check out the help for FindFile.

View solution in original post

You can as well try Is command

https://community.flexera.com/t5/InstallShield-Knowledge-Base/Detecting-When-a-Reboot-Is-Necessary/t...

if (Is(FILE_EXISTS, WINDIR ^ "Wininit.ini") = TRUE) then
....

View solution in original post

2 Replies
rguggisberg
Level 13

Check out the help for FindFile.

View solution in original post

You can as well try Is command

https://community.flexera.com/t5/InstallShield-Knowledge-Base/Detecting-When-a-Reboot-Is-Necessary/t...

if (Is(FILE_EXISTS, WINDIR ^ "Wininit.ini") = TRUE) then
....

View solution in original post