This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Issues with LaunchApp while Upgrading from 2008 to 2011
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 28, 2011
08:43 AM
Issues with LaunchApp while Upgrading from 2008 to 2011
We have an installer that runs several command files during the install. In IS 2008 we used LaunchApp and it worked. Now in IS 2011 it no longer works. The reason is that he command is executing with the working directory of C:\Windows\System32 and not the directory of where the command file is located at.
The code is as follows:
Cmd = INSTALLDIR^"Product Directory\\Commandfile.cmd";
LongPathToQuote(Cmd, TRUE);
Result = LaunchAppAndWait (Cmd, "", LAAW_OPTION_WAIT | LAAW_OPTION_HIDDEN);
I have tried Adding the Option LAAW_OPTION_CHANGEDIRECTORY
I switched to using LaunchApplication and passed in the directory and I tried using ChangeDirectory before he call all to no avail.
Does anyone have any guidance on how I can execute the command file with its working directory set to where it is located?
Thanks
Kevin McKenzie
The code is as follows:
Cmd = INSTALLDIR^"Product Directory\\Commandfile.cmd";
LongPathToQuote(Cmd, TRUE);
Result = LaunchAppAndWait (Cmd, "", LAAW_OPTION_WAIT | LAAW_OPTION_HIDDEN);
I have tried Adding the Option LAAW_OPTION_CHANGEDIRECTORY
I switched to using LaunchApplication and passed in the directory and I tried using ChangeDirectory before he call all to no avail.
Does anyone have any guidance on how I can execute the command file with its working directory set to where it is located?
Thanks
Kevin McKenzie
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 29, 2011
06:29 AM
Try using LaunchAppAndWait i the following manner:
LaunchAppAndWait ( szProgram, szCmdLine, nOptions );
where
szProgram = ""
szCmdLine = path to the Commandfile.cmd file
nOptions = your options.
------------------------------------------------------
also try this
szProgram = path to cmd.exe
szCmdLine = path to the Commandfile.cmd file
nOptions = your options.
------------------------------------------------------
also try this
szProgram = "cmd.exe"
szCmdLine = path to the Commandfile.cmd file
nOptions = your options.
Also look at ChangeDirectory(). This is an Installscript function. You can use this in place of LAAW_OPTION_CHANGEDIRECTORY if the above options do not work.
Hope this helps...
LaunchAppAndWait ( szProgram, szCmdLine, nOptions );
where
szProgram = ""
szCmdLine = path to the Commandfile.cmd file
nOptions = your options.
------------------------------------------------------
also try this
szProgram = path to cmd.exe
szCmdLine = path to the Commandfile.cmd file
nOptions = your options.
------------------------------------------------------
also try this
szProgram = "cmd.exe"
szCmdLine = path to the Commandfile.cmd file
nOptions = your options.
Also look at ChangeDirectory(). This is an Installscript function. You can use this in place of LAAW_OPTION_CHANGEDIRECTORY if the above options do not work.
Hope this helps...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 29, 2011
02:22 PM
I had already tried the ChangeDirectory call to no avail.
I tried to set Cmd to the cmd.exe and the Args to the command file.
Cmd = INSTALLDIR^"Product Directory\\Command File.cmd";
LongPathToQuote(Cmd, TRUE);
CmdExe = WINDIR^"System32\\CMD.EXE";
nResult = LaunchAppAndWait (CmdExe, Cmd, LAAW_OPTION_WAIT);
NumToStr(tmp, nResult);
return nResult;
It brings up the command window but does not run the file, just sits there at the command prompt.
What I have done to get around this is put the command file in the CMD and pass in the directory as a parameter in the arg and then modified the command files to change directory to the passed param. It works but I would rather do it the right way and not like that.
If anyone has any ideas please let me know
Thanks
Kevin McKenzie
I tried to set Cmd to the cmd.exe and the Args to the command file.
Cmd = INSTALLDIR^"Product Directory\\Command File.cmd";
LongPathToQuote(Cmd, TRUE);
CmdExe = WINDIR^"System32\\CMD.EXE";
nResult = LaunchAppAndWait (CmdExe, Cmd, LAAW_OPTION_WAIT);
NumToStr(tmp, nResult);
return nResult;
It brings up the command window but does not run the file, just sits there at the command prompt.
What I have done to get around this is put the command file in the CMD and pass in the directory as a parameter in the arg and then modified the command files to change directory to the passed param. It works but I would rather do it the right way and not like that.
If anyone has any ideas please let me know
Thanks
Kevin McKenzie
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 30, 2011
01:41 AM
Did you try all the three options?
Even the one where you pass ""(empty string) as the first parameter?
Also, check the existence of the said file before calling LaunchAppandWait.
Even the one where you pass ""(empty string) as the first parameter?
Also, check the existence of the said file before calling LaunchAppandWait.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 01, 2011
09:37 AM
Yes I ran all three
LaunchAppAndWait(CommandFile,"",LAAW_OPTION_WAIT) Runs in Windows/system32 Directory so the cammand script does not work as required
LaunchAppAndWait("", CommandFile,LAAW_OPTION_WAIT) Runs in Windows/system32 Directory so the cammand script does not work as required
LaunchAppAndWait("Cmd.exe", CommandFile,LAAW_OPTION_WAIT) Runs in Windows/system32 Dir But just opens a command window and sits at the prompt
LaunchAppAndWait("C:\Winsows\System32\Cmd.exe", CommandFile,LAAW_OPTION_WAIT) Runs in Windows/system32 Dir But just opens a command window and sits at the prompt
I also did this with the Change Directory Option and A File Exists Check and no change.
I am now reconfiguring my command files to accept the working directory as a parameter and to do a specific change directory command before running the rest of the script.
I have a tech support ticket open wih Flexaera on this and will post if I find anything else out. Other than that I will proceed with the parameter solution.
Thanks
Kevin McKenzie
LaunchAppAndWait(CommandFile,"",LAAW_OPTION_WAIT) Runs in Windows/system32 Directory so the cammand script does not work as required
LaunchAppAndWait("", CommandFile,LAAW_OPTION_WAIT) Runs in Windows/system32 Directory so the cammand script does not work as required
LaunchAppAndWait("Cmd.exe", CommandFile,LAAW_OPTION_WAIT) Runs in Windows/system32 Dir But just opens a command window and sits at the prompt
LaunchAppAndWait("C:\Winsows\System32\Cmd.exe", CommandFile,LAAW_OPTION_WAIT) Runs in Windows/system32 Dir But just opens a command window and sits at the prompt
I also did this with the Change Directory Option and A File Exists Check and no change.
I am now reconfiguring my command files to accept the working directory as a parameter and to do a specific change directory command before running the rest of the script.
I have a tech support ticket open wih Flexaera on this and will post if I find anything else out. Other than that I will proceed with the parameter solution.
Thanks
Kevin McKenzie
