Hi,

As part of an upgrade from Wix 2 to 3.5 the following is no longer working:

<?define pathVar = "[%%CommonProgramFiles]\path\to\folder" ?>
<Environment Id='OURPROD_TGT_PATH' Name="path" Value="$(var.pathVar)"
Part="first" System="yes" Action="set"/>

as it gives: error LGHT0204 : ICE03: Invalid format string; Table:
Environment, Column: Value, Key(s): OURPROD_TGT_PATH.GUID_HERE

I found posts online saying to escape the brackets so [ becomes [\[]
and ] becomes [\]]. Doing so got rid of the error, but then the value
ends up being escaped in the MSI; if you view it in orca you see the
value is "[\[]%CommonProgramFiles[\]]\path\to\folder;[~]" which
includes the escaping. The value we want is
"[%CommonProgramFiles]\path\to\folder;[~]" but if we don't escape it
we get the above error.

Interestingly, it works fine if the value is hardcoded rather than
being a variable, so the following:

<Environment Id='OURPROD_TGT_PATH' Name="path"
Value="[%%CommonProgramFiles]\path\to\folder" Part="first"
System="yes" Action="set"/>

produces the correct value in the MSI:

[%CommonProgramFiles]\path\to\folder;[~]

Does anyone know why this doesn't work if the value comes from a
variable? Do we need to escape the variable somehow so that Wix just
puts the exact text of the variable into the environment table? We use
this variable in a couple other places and it's set conditionally
based on build parameters so it would be nice to not have to hardcode
it everywhere.

Thanks!
John Fry

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to