3

I have a WiX installer and I am following wix-tricks-and-tips

My variables all work fine, but I am flooded with 100's of warnings due to this:

<Component Id="C.Content.2011.1.414" DiskId="1" Guid="MYGUID" Win64="$(var.Win64)" KeyPath="yes">

I receive the warning:

Warning 1 The 'Win64' attribute is invalid - The value '$(var.Win64)' is invalid according to its datatype 'http://schemas.microsoft.com/wix/2006/wi:YesNoType' - The '$' character, hexadecimal value 0x24, cannot be included in a name.

yet:

<?xml version="1.0" encoding="utf-8"?>
<Include>
  <?if $(var.Platform) = x64 ?>
    <?define Win64 = "yes" ?>
    <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
  <?else ?>
    <?define Win64 = "no" ?>
    <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
  <?endif ?>
</Include>

clearly Win64 is yes/no... how do I avoid this warning?

Thanks

Community
  • 1
  • 1
Sean Anderson
  • 27,963
  • 30
  • 126
  • 237
  • Do you actually need to specify the Win64 attribute for the component? I followed the same post as you and thus got the same warning. Then I read the docs for the Component Win64 attribute, which indicate that the default value is taken from the architecture of the installer project itself. Thus I removed the attribute altogether to no ill effect. – Daniel Pratt Dec 30 '11 at 22:46
  • Oh yeah! I remember I did read (and do) that, but then, later, backed out of some changes I made and forgot about it. Let me try making an installer real quick and see if things work out. :) – Sean Anderson Dec 30 '11 at 22:48
  • @DanielPratt You're indeed correct. If you'd like you can respond more formally and I'll accept it as the answer. – Sean Anderson Dec 30 '11 at 23:12
  • would this work better? `` – Califf Dec 19 '16 at 21:42

1 Answers1

5

The answer is to just remove the Win64 variable altogether. Once you have your platform build targets setup properly WiX can just figure it out.

Sean Anderson
  • 27,963
  • 30
  • 126
  • 237