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

Rob Mensching rob at firegiant.com
Thu Jul 23 07:11:00 PDT 2020


That is standard cmd.exe behavior. 

---
Short replies here. Complete answers here: https://www.firegiant.com/services/

-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Johan Heikkila via wix-users
Sent: Thursday, July 23, 2020 12:29 AM
To: wix-users at lists.wixtoolset.org
Cc: Johan Heikkila <johan.heikkila at fi.abb.com>
Subject: [wix-users] Issue with bundle variable on command line

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.

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/



More information about the wix-users mailing list