Trouble with CMDLINE and spaces in parameters

Got a problem you cannot solve? Try here.
Post Reply
ZviZemel
Posts: 15
Joined: Thu Nov 13, 2008 3:33 pm

Trouble with CMDLINE and spaces in parameters

Post by ZviZemel »

Hello,

I've build a compressed .exe installer and I've wrapped it in a group policy MSI. I need to pass values in from the MSI on the command line to the exe, such as $TARGETDIR$. I know I can set CMDLINE to contain these parameters, but I can't make it work when the parameter values have spaces.

In this thread (http://www.installaware.com/forum/viewt ... dline#4302) it looks like I should use:

setup.msi CMDLINE='"PARAM1=pre post"' but in this case I just get a windows installer dialog popping up that tells me what the command line options are for msiexec. It clearly doesn't like parsing my line.

Any advice on how to properly pass parameters in CMDLINE with spaces in the values would be extremely helpful

Thanks
Zvi
CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Post by CandiceJones »

Add /i and that will help.
Candice Jones
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
ZviZemel
Posts: 15
Joined: Thu Nov 13, 2008 3:33 pm

Post by ZviZemel »

Hi Candice,

thanks for the reply. I have been using /i, but forgot to include it above in my original post. Sorry for that.

The original question still stands. I'm really not clear on how group policy MSIs can be used to pass parameters to the exe installer with spaces in the values.

Edit: Sorry, I should have said that when I use the /i option it is with msiexec, as in:
msiexec /i setup.msi CMDLINE='PARAM="my value"'


Thanks
Zvi
ZviZemel
Posts: 15
Joined: Thu Nov 13, 2008 3:33 pm

Post by ZviZemel »

An update:

sometimes I *am* able to get the msi to launch with the command line specified above. I'm not clear on why this sometimes works and sometimes doesn't, or maybe I'm just making a silly mistake.

In any case, when it does launch with the above command line, the value for the variable does not get set.

I'm really not sure if this functionality to push variables through to the exe is broken or not.

Thanks
Zvi
ZviZemel
Posts: 15
Joined: Thu Nov 13, 2008 3:33 pm

Post by ZviZemel »

If anyone is curious, the way around my problem is to escape a double-quote in the value of CMDLINE with a double-quote.

So if you need to call the MSI from the command line and pass parameters PARAM1 and PARAM2 to the setup.exe and the values of those parameters need to have spaces in them, you could do it like this:

setup.msi CMDLINE="PARAM1=""value with space"" PARAM2=""value with space"""

Note the three double-quotes at the end; two of them are to close off PARAM2 and the last one is to close off CMDLINE.

Hope this helps
bmills42
Posts: 5
Joined: Tue Mar 13, 2007 2:26 pm

Post by bmills42 »

ZviZemel wrote:If anyone is curious, the way around my problem is to escape a double-quote in the value of CMDLINE with a double-quote...

...Hope this helps
Thank you. It was very helpful.
Post Reply