1
votes

using Wix 3.11, project built using msbuild 14.0.25420.1

I've come across a situation where a string I define in a proprocessor variable is having the enclosing quotes included within the variable value.

I would appreciate if someone could tell me:

  1. why this behaviour occurs ( am I doing something wrong ? )
  2. how I would quote a string value with spaces

The project has a main .wxs file, plus a number of .wxi Include files.

In the main Product.wxs within the Wix element:

<?define registry_key_path="SOFTWARE\MySoftwareGroup\MySoftware" ?>

Then in an include file Component.wxi within a Component element:

<RegistryValue
  Root="HKLM"
  Key="$(var.registry_key_path)"
  Name="InstallFolder"
  Value="[INSTALLDIR]"
  Type="string" />

The install fails with error:

Error 1406. Could not write value InstallFolder to key \"SOFTWARE\MySoftwareGroup\MySoftware"

You can see that the key contains the quotes. It should read:

\SOFTWARE\MySoftwareGroup\MySoftware

If I remove the quotes from the define:

<?define registry_key_path=SOFTWARE\MySoftwareGroup\MySoftware ?>

the installer correctly parses the variable and finds the right registry key and writes to it.

Why are the quotes being included?

How would I quote the string value if it contained a space?

1

1 Answers

1
votes

Works for me with WiX v3.11.1.2318. Open your .msi in Orca to inspect the Registry table and see if the quotes exist there. If you can reproduce it in a small example .wixproj, please open a bug.