为什么wix项目会出错?
Why there is an error in a wix project?
我正在使用 Wix 工具集 3.8 并尝试创建一个 msi 项目。在构建时我遇到了这样的错误:
Severity Code Description Project File Line
Error '.', hexadecimal value 0x00, is an invalid character. Analyzer light.exe 0
有人遇到过这样的问题吗?任何帮助将不胜感激!我是这个领域的初学者......
这是源代码:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<?define ProductName="Traffic_Analyzer" ?>
<?define ProductVersion="1.0.0.0" ?>
<?define ProductCode="*"?>
<?define UpgradeCode="9e36a864-f98e-446a-b2e6-dd77567a4031"?>
<?define Manufacturer="Leanenka_Dzianis"?>
<?define licenseRtf="C:\Users\DzianisL\Desktop\license.rtf"?>
<Product Id="$(var.ProductCode)" Name="$(var.ProductName)" Language="1049" Version="$(var.ProductVersion)"
Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<!--1033 on 1049 - Russian language maintaines-->
<Package InstallerVersion="200" Compressed="yes" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="$(var.ProductName)">
<Component Id="ProductComponent" Guid="*">
<File Id='Sniffer' DiskId='1' Source='C:\Users\DzianisL\Documents\Visual Studio 2015\Projects\Sniffer\Sniffer\bin\Release\Sniffer.exe'/>
</Component>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="$(var.ProductName)">
<Component Id="ApplicationShortcutSniffer" Guid="4CEBD68F-E933-47f9-B02C-A4FC69FDB551">
<Shortcut Id="ShortcutSniffer"
Name="Sniffer"
Description="$(var.ProductName)"
Target="[INSTALLLOCATION]Sniffer.exe"
WorkingDirectory="INSTALLLOCATION"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software$(var.Manufacturer)$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="ProductFeature" Title="$(var.ProductName)" Level="1">
<ComponentRef Id="ProductComponent" />
<ComponentRef Id="ApplicationShortcutSniffer" />
</Feature>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" ></Property>
<WixVariable Id="WixUILicenseRtf" Overridable="yes" Value="$(var.licenseRtf)"/>
<UIRef Id="WixUI_InstallDir"/>
</Product>
</Wix>
WiX 问题跟踪器中有一个 open bug report,表明错误与以空字符结尾的 RTF 文件有关。
我会检查您的 license.rtf 是否以 null 结束,然后从文件中截断该字符(或创建一个没有 null 的新 RTF 文件)
我解决了这个错误:
'.', hexadecimal value 0x00, is an invalid character
通过评论这一行:
<UIRef Id="WixUI_InstallDir" />
我正在使用 Wix 工具集 3.8 并尝试创建一个 msi 项目。在构建时我遇到了这样的错误:
Severity Code Description Project File Line
Error '.', hexadecimal value 0x00, is an invalid character. Analyzer light.exe 0
有人遇到过这样的问题吗?任何帮助将不胜感激!我是这个领域的初学者...... 这是源代码:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<?define ProductName="Traffic_Analyzer" ?>
<?define ProductVersion="1.0.0.0" ?>
<?define ProductCode="*"?>
<?define UpgradeCode="9e36a864-f98e-446a-b2e6-dd77567a4031"?>
<?define Manufacturer="Leanenka_Dzianis"?>
<?define licenseRtf="C:\Users\DzianisL\Desktop\license.rtf"?>
<Product Id="$(var.ProductCode)" Name="$(var.ProductName)" Language="1049" Version="$(var.ProductVersion)"
Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<!--1033 on 1049 - Russian language maintaines-->
<Package InstallerVersion="200" Compressed="yes" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="$(var.ProductName)">
<Component Id="ProductComponent" Guid="*">
<File Id='Sniffer' DiskId='1' Source='C:\Users\DzianisL\Documents\Visual Studio 2015\Projects\Sniffer\Sniffer\bin\Release\Sniffer.exe'/>
</Component>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="$(var.ProductName)">
<Component Id="ApplicationShortcutSniffer" Guid="4CEBD68F-E933-47f9-B02C-A4FC69FDB551">
<Shortcut Id="ShortcutSniffer"
Name="Sniffer"
Description="$(var.ProductName)"
Target="[INSTALLLOCATION]Sniffer.exe"
WorkingDirectory="INSTALLLOCATION"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software$(var.Manufacturer)$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="ProductFeature" Title="$(var.ProductName)" Level="1">
<ComponentRef Id="ProductComponent" />
<ComponentRef Id="ApplicationShortcutSniffer" />
</Feature>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" ></Property>
<WixVariable Id="WixUILicenseRtf" Overridable="yes" Value="$(var.licenseRtf)"/>
<UIRef Id="WixUI_InstallDir"/>
</Product>
</Wix>
WiX 问题跟踪器中有一个 open bug report,表明错误与以空字符结尾的 RTF 文件有关。
我会检查您的 license.rtf 是否以 null 结束,然后从文件中截断该字符(或创建一个没有 null 的新 RTF 文件)
我解决了这个错误:
'.', hexadecimal value 0x00, is an invalid character
通过评论这一行:
<UIRef Id="WixUI_InstallDir" />