PDA

View Full Version : CA launching cmd.exe



mmcbride
12-15-2003, 05:15 PM
Hello, I am trying to create a custom action that will run the following command line:
cmd.exe /c start /wait "" "c:\program files\common files\mycompany\myprogram.exe" /MyParameter

I created a custom action type 34 (launch an executable stored in the directory table - SystemFolder) with Target
cmd.exe /c start /wait "" "[INSTALLDIR]myprogram.exe" /MyParameter

When I run the install, the CA runs, but the cmd box only flashes and does not actually run my executable with the parameter.

If I create an install without the CA and run the command line from Start, Run, it works fine.

Does anyone know what I am doing wrong? Any help would be appreciated!!

Thank you,
mmcbride

TsungH
12-15-2003, 06:44 PM
The quotes seem odd to me. How about having the custom action launching myprogram.exe directly with the parameter, instead of using cmd.exe?

mmcbride
12-16-2003, 09:36 AM
Thanks for the reply. Unfortunately, myprogram.exe returns immediately even though it has not finished executing. So when I try to make this work with a CA just launching my executable with /MyParameter, the CA runs, but myprogram.exe does not actually finish running. Unfortunately, I do not have control over myprogram.exe. The programmer recommended:

start /wait myprogram.exe /MyParameter

I added the path and cmd.exe to make:

cmd.exe /c start /wait "" "<path>\myprogram.exe" /MyParameter

I need the quotes to surround the path to myprogram.exe. I found info that the double quotes are needed ahead of that for cmd.exe to read it correctly. I do think that this part is ok since it does work from Start, Run. (It does not work without the double quotes preceding the path.)

Any other ideas, anyone? Thanks again,
mmcbride

TsungH
12-16-2003, 05:18 PM
It does not have enough information on your custom action. It could be something obvious. Can you post your custom action settings?

mmcbride
12-17-2003, 09:53 AM
Thanks for the response.

It is a custom action type 34.
Type: Launch an executable
Location: Stored in the Directory Table
Source: SystemFolder
Target: cmd.exe /c start /wait "" "[INSTALLDIR]myprogram.exe" /MyParameter
Wait for the action to finish executing is checked
Ignore custom action return code is not checked
Immediate Execution
Always execute

It is placed in the InstallExecuteSequence immediately following InstallFinalize.

I have tried all different combinations of checking and not checking Wait for the action to finish executing and Ignore custom action return code. The results do not change.

Thank you,
mmcbride