Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 3

please help: using custom command line args

I've got a Basic MSI project. I'm passing in some custom command line arguments via the following format...

setup.exe /v"ISSCRIPTCMDLINE=\"-zTEST\""

according to some info i've found online, this should result in the CMDLINE variable holding the string TEST.

I want to take this string and use it inside a custom action that runs an executable... so, for example, I want my custom action to run "myscript.bat /f [CMDLINE]"

When i do this, it ends up just running "myscript.bat /f" -- why is it not running "myscript.bat /f TEST"?

What am i doing wrong? Is this even possible?

Thanks in advance.
Labels (1)
0 Kudos
(2) Replies
Level 8

Declare a public property MYCMDLINE.
run setup.exe /v"MYCMDLINE=TEST"

In custom action use
MsiGetProperty(ISMSI_HANDLE, "MYCMDLINE",szCmdLine, nvBufferSize); and use szCmdLine while calling batch file.
0 Kudos
Level 6

I am also using Basic MSI.

What if I may (or may not) have multipe command options? E.g.


Is there any way to catch the whole commandline (i.e. setup.exe /v"MYCMDLINE1=TEST1 MYCMDLINE2=TEST2 MYCMDLINE3=TEST3")? I hope there is a property I can use in VBS.
0 Kudos