cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mfd001
Level 5

EXE Custom Action calling cmd.exe

Hi!

I have a problem. I have a custom action that I want to run silenty but I am not able to find a way to do that.

cmd.exe /c "[VS2008DIR][VSEXE]"/command Tools.InstallCommunityControls

As you can see, a call on cmd.exe to run a nother exe where [VS2008DIR] is the path and [VSEXE] is the name of the exe file. The rest is the command line.

I am picking up the propertys in the appsearch so this is not included in my package so I don´t know where they are on the destination system.

What happened is that the cmd.exe lanches a command prompt and opens the exe file and then closes when the command is finished. I want that to run silently..

Any thoughts?
Labels (1)
0 Kudos
(8) Replies
forcet
Level 4

u don't need to execute the cmd.exe

if u create "new exe" custom action, installshield will launch the shell for u.

in your case, firstly, u need to create a property whose value is your exe file's lacation, then use the "new exe"->"path in property value" create a custom action.

I'm not sure whether this is a the answer u want
0 Kudos
mfd001
Level 5

The thing is that I dont know the path or the name of the exe. I do a system search for a regfile and fil in the Propertys and than I need to lanch the exe file.. When I try to lanch it with the "Property Custum Action" It fails.
0 Kudos
forcet
Level 4

make sure you set the property which is the exefile path before the custom action gets invoked.

also, if you search the exe file in script you can launch the exefile directly in script. I just asked this question and ChandanOmkar gave me the answer.

see:http://community.installshield.com/showthread.php?t=191043
0 Kudos
mfd001
Level 5

Can I do this silenty?
0 Kudos
KathyMorey
Level 10

I'm not sure if I'm misunderstanding you, but it sounds like you need to follow this sequence:

Do the system search to fill in the property containing the path.

Create a "set a directory" custom action to set a path equal to the value of the property.

Create a "launch an executable" custom action using the directory entry created, with any parameters the program needs.
0 Kudos
mfd001
Level 5

I will try it.. Sounds good.
0 Kudos
forcet
Level 4

the LaunchApplication has a "nShowWindow" argument, which can be set to SW_HIDE. also you can launch an exe file with parameter /S, and pass "/qn" to msiexec.

eg: PATH_TO_FILE/xxx.exe /S /V"YOUR_SILENTMODE_PARAMS /qn"
0 Kudos
mfd001
Level 5

Thanks for all the help!!

I have found a solution!..

#define APPLICATION szProgram
#define CMD_LINE szCmdLine
//#define wShowWindow
// Include Ifx.h for built-in InstallScript function prototypes.
#include "Ifx.h"
export prototype ExFn_LaunchApp(HWND);
function ExFn_LaunchApp(hInstall)
STRING svValue,szProgram,szCmdLine;
NUMBER nTimeOut,nShowWindow,ntOptions;

begin

szProgram = ("C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\Devenv.exe");
szCmdLine = "/command Tools.InstallCommunityControls";
LaunchApplication (szProgram, szCmdLine, "", SW_HIDE,nTimeOut, LAAW_OPTION_SHOW_HOURGLASS);

if (LaunchApp (APPLICATION, CMD_LINE) < 0) then
MessageBox ("Unable to launch "+APPLICATION+".", SEVERE);
endif;
end;
0 Kudos