Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Passing Command line Arguments with CA


3 replies to this topic

MikeG

MikeG
  • Members
  • 10 posts

Posted 22 September 2004 - 19:00

I am building a project using ISWI Ver. 1.52. In this project I am trying to run a separate install exe to install third party drivers. I have created a custom action called MyFunction, which is called after InstallFinalize. The script compiles as Setup.rul with 0 Errors and 0 Warnings.

Here is the script;

#include "isrt.h"

#include "iswi.h"

export prototype MyFunction(HWND);

function MyFunction(hMSI)

STRING szProgram, szCmdline;

begin

szProgram = "WINDIR^cmd.exe";
szCmdline = "C:\\Dongle\\install.exe /b";

LaunchAppAndWait (szProgram, szCmdline, WAIT);

end;


When I run the build in “Debug My Release” the script is called and displayed in InstallShield Script Debugger Ver. 6. The rest of the installation waits just as expected.
As I step into the script the variable szProgram gets set as “C:\WINNT\cmd.exe”

The variable szCmdline gets set as “C:Dongleinstall.exe /b” Of course the syntax is not correct for a command line argument so the install.exe doesn’t run. After completing the script ISWI continues with the rest of the install without error.

What is the correct syntax in the Installscript to display this command line properly?

Thanks for your help.


Thank you for sharing your brain.[br]Mike G.

AshinSmart

AshinSmart
  • Members
  • 5 posts

Posted 23 September 2004 - 07:24

The following should work.

szProgram = WINDIR ^ "cmd.exe C:\\Dongle\\install.exe ";
szCmdline = "/b";

LaunchAppAndWait (szProgram, szCmdline, WAIT);


MikeG

MikeG
  • Members
  • 10 posts

Posted 23 September 2004 - 17:05

Thank you for the reply AshinSmart. I tried as suggested and the 2 strings, szProgram and szCmdline are still displaying the same in the debugger.

szCmdline “C:Dongleinstall.exe /b”

szProgram “C:\WINNT\cmd.exe”

Is there a legacy file that needs to be removed to get the script to recognize the new syntax?
Thank you for sharing your brain.[br]Mike G.

AshinSmart

AshinSmart
  • Members
  • 5 posts

Posted 01 October 2004 - 05:58

Very Sorry Mike,
Here comes the actual solution.
I am presenting a sample code, which actually works for me.

CODE
function RegisterMyRegSettings(hMSI)  
   STRING RegPath;
begin
   RegPath = INSTALLDIR + "install\\CFG.reg";
   LongPathToQuote(RegPath,TRUE);
   LaunchAppAndWait (WINDIR ^ "Regedit.exe", "/s " + RegPath);
end


The LongPathToQuote does the actual magic

Edited by AshinSmart, 01 October 2004 - 06:00.

With regards
Ashin