[wix-users] Issue with bundle variable on command line

Johan Heikkila johan.heikkila at fi.abb.com
Thu Jul 23 00:29:23 PDT 2020


Hi,

I'm using Wix 3.11. I have a specific issue setting paths in variables on bundle command line. I wonder if this is a bug, or if it is me missing something. I have tried searching.

So normally you would do like this when setting a variable containing a path on the bundle command line: 

   MyBundle.exe MYVARIABLE="<drive letter>:\<some path>"

This works in general, but I've encountered a special case where it doesn't. When you use quotes and end the path with a backslash (which I am required to do in my case), it will have unexpected results: 

   MyBundle.exe MYVARIABLE="D:\"

Now this doesn't work. The resulting variable value becomes literally D:" without backslash and containing an ending quote in the variable value itself. So clearly the ending backslash and quote is interpreted as a literal quote on some level. I can't tell if the problem is in the Windows shell or Wix.

The following variants do work without changing the value (the latter two don't have the ending backslash, so not useful in my case): 

   MyBundle.exe MYVARIABLE=D:\
   MyBundle.exe MYVARIABLE=D:
   MyBundle.exe MYVARIABLE="D:"

The following example also kind of works and results in that the variable value correctly becomes D:\ with a single backslash at the end: 

   MyBundle.exe MYVARIABLE="D:\\"

So workaround for the issue is to use double backslash at the end of the path when using quotes, OR to not use quotes at all (and then you can't have paths with spaces), but that's really not something I would like to document with our product.

Can anyone explain what happens with the MYVARIABLE="D:\" example and if this could possibly be a bug in Wix?

Best regards,
Johan H.


More information about the wix-users mailing list