1

Can anyone give me a good example or set me on the correct direction to enable my installers for 32-bit and 64-bit. I am using Wix 3.6.

I have tried this:

<?if $(var.Platform) = x64 ?>
<?define ProductName = "InsomniacGeek: Windows Setup Test (64 bit)" ?>
<?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define ProductName = "InsomniacGeek: Windows Setup Test" ?>
<?define Win64 = "no" ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>


<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="$(var.Platform)" />

It doesn't like this however, its says the Platform attribute is invalid, has anyone got this functioning and could help me please?

Natalie Carr
  • 3,707
  • 3
  • 34
  • 68
  • If you compile this for different platforms your get two MSIs, hopefully at different locations so that you can use them. But the title of the question is irritating because you have one WXS and two MSIs. – harper Jan 15 '17 at 12:20

1 Answers1

2

That's exactly the way I do it, and it works perfectly well.

You get a squiggly line and a warning in Votive because the literal text $(var.Platform) isn't one of the platform enumeration values defined in the XML Schema for WiX source files. Once the preprocessor finishes with the file, the attribute's value is valid and candle will happily accept it.

Edited to add: This question and its answers are a great WiX resource.

Community
  • 1
  • 1
anton.burger
  • 5,637
  • 32
  • 48