How to avoid 'Win64' attribute is invalid when using variables in a WiX installer script?

跟風遠走 提交于 2019-12-23 17:26:55

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/8684692/how-to-avoid-win64-attribute-is-invalid-when-using-variables-in-a-wix-installe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!