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

Johan Heikkila johan.heikkila at fi.abb.com
Thu Jul 23 23:38:39 PDT 2020


OK, thank you for confirming that.

Regards,
Johan H.

-----Original Message-----
From: Rob Mensching <rob at firegiant.com> 
Sent: torsdag 23 juli 2020 17:11
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Johan Heikkila <johan.heikkila at fi.abb.com>
Subject: RE: Issue with bundle variable on command line

This email originated from outside of your organization. Please do not click on links or open attachments unless you recognize the sender and know the content is safe.


That is standard cmd.exe behavior.

---
Short replies here. Complete answers here: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.firegiant.com%2Fservices%2F&data=02%7C01%7C%7Cb2d2b3b2a4b446fd39a708d82f123b27%7C372ee9e09ce04033a64ac07073a91ecd%7C0%7C0%7C637311102635562866&sdata=%2B4DHQO3w%2BuHc3GMRqTMfqREYZX6fFGe6M5hw4zNHvA8%3D&reserved=0

-----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 https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.firegiant.com%2F&data=02%7C01%7C%7Cb2d2b3b2a4b446fd39a708d82f123b27%7C372ee9e09ce04033a64ac07073a91ecd%7C0%7C0%7C637311102635562866&sdata=CerSNoA1kNby%2B5BgziJNeRwETO3xOZTMM15%2FSJdC9TM%3D&reserved=0



More information about the wix-users mailing list