jjzjj

xml - Wix - ICE60 和 ICE69 警告

coder 2024-06-24 原文

我在使用 WiX 时遇到了一些问题。我当前的警告是 ICE60,它告诉我我的 .ttf 文件不是字体,并且它的版本不是配套文件引用。它应该在“语言”列中指定一种语言。

此警告的问题是我无法为文件设置语言版本。根据有关此警告的 MSDN 文档,我可以通过向字体文件添加版本来抑制它。不完全确定如何!

我的下一个警告是 ICE69,不匹配的组件引用。快捷方式表的条目“ApplicationStartMenuShortcut”属于组件“ApplicationShortcut”。但是,“目标”列中的格式化字符串引用属于组件“MyApp.exe”的文件“MyApp.exe”。组件具有相同的功能。

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<?include "config.wxi"?>
<Product Id="*" UpgradeCode="67bd6fc7-c75b-434b-a305-2808541f8185" Version="1.0.0.0" Language="1033" Name="MyApp" Manufacturer="MyApp">

    <Package InstallerVersion="300" Compressed="yes"/>
    <Media Id="1" Cabinet="MyApp.cab" EmbedCab="yes" />

    <PropertyRef Id="NETFRAMEWORK45" />

    <Condition Message="This application requires .NET Framework 4.5. Please install the .NET Framework then run this installer again.">
        <![CDATA[Installed OR NETFRAMEWORK45]]>
    </Condition>

    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="APPLICATIONROOTDIRECTORY" Name="MyApp">
                <Directory Id="RESOURCESDIRECTORY" Name="Resources" />
            </Directory>
        </Directory>
        <Directory Id="ProgramMenuFolder">
            <Directory Id="ApplicationProgramsFolder" Name="MyApp"/>
        </Directory>
    </Directory>

    <Icon Id="_MyApp.ico" SourceFile="$(var.SourceDir)\Resources\MyApp.ico" />
    <Property Id="ARPPRODUCTICON" Value="_MyApp.ico" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />

    <DirectoryRef Id="APPLICATIONROOTDIRECTORY">
        <Component Id="MyApp.exe" Guid="*">
            <File Id="MyApp.exe" Source="$(var.SourceDir)\MyApp.exe" KeyPath="yes" Checksum="yes"/>
        </Component>
        <Component Id="Xceed.Wpf.Toolkit.dll" Guid="*">
            <File Id="Xceed.Wpf.Toolkit.dll" Source="$(var.SourceDir)\Xceed.Wpf.Toolkit.dll" KeyPath="yes" Checksum="yes" />
        </Component>
    </DirectoryRef>
    <DirectoryRef Id="RESOURCESDIRECTORY">
        <Component Id="MyApp.ico" Guid="*">
            <File Id="MyApp.ico" Source="$(var.SourceDir)\Resources\MyApp.ico" KeyPath="yes" />
        </Component>
        <Component Id="FontAwesome.ttf" Guid="*">
            <File Id="FontAwesome.ttf" Source="$(var.SourceDir)\Resources\FontAwesome.ttf" KeyPath="yes" />
        </Component>
    </DirectoryRef>
    <DirectoryRef Id="ApplicationProgramsFolder">
        <Component Id="ApplicationShortcut" Guid="*">
            <Shortcut Id="ApplicationStartMenuShortcut"
                      Name="MyApp"
                      Description="Off-browser chat client for MyApp"
                      Target="[#MyApp.exe]"
                      WorkingDirectory="APPLICATIONROOTDIRECTORY" />
            <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall" />
            <RegistryValue Root="HKCU" Key="Software\Microsoft\MyApp" Name="installed" Type="integer" Value="1" KeyPath="yes" />
        </Component>
    </DirectoryRef>

    <Feature Id="MainApplication" Title="Main Application" Level="1">
        <ComponentRef Id="MyApp.exe" />
        <ComponentRef Id="Xceed.Wpf.Toolkit.dll" />
        <ComponentRef Id="MyApp.ico" />
        <ComponentRef Id="FontAwesome.ttf" />
        <ComponentRef Id="ApplicationShortcut" />
    </Feature>
</Product>
</Wix>

尽管有这两个警告,该应用程序仍能正常安装和运行。虽然谁喜欢警告,嗯?

非常感谢对这些错误的任何帮助,我不想完全压制它们,以防万一存在潜在问题。

最佳答案

关于 ICE69 警告,我想我会就此提供更全面的讨论,因为我自己刚刚经历过这个......


来自MSDN documentation for ICE69 :

Problems with cross-component referencing arise from the way formatted strings are evaluated. If the component referenced with the [$componentkey] property is already installed and is not being changed during the current installation (for example, being reinstalled, moved to source, and so forth), the expression [$componentkey] evaluates to null, because the action state of the component in [$componentkey] is null. Similar problems can occur during upgrade and repair operations.

文档继续解释当引用跨越不同功能的组件时,消息是一个错误,因为定义功能可能没有安装,而引用功能是,导致字符串的空值。

当两个组件具有相同的功能时,大概是因为一个组件只与另一个一起安装,所以可以安全地使用该字符串。因此您会收到警告,表明您正在做一些可能不安全但可能会奏效的事情。

有很多方法可以解决这个问题,包括:

  • 大锤:只是禁用警告。打开 WiX 项目的属性,选择“工具设置”选项卡,然后在“禁止特定 ICE 验证:”字段中输入“ICE69”:

  • 实用:通过格式化字符串解释方式的一个怪癖,您可以使用语法 [!...] 而不是 [#. ..] 并欺骗编译器忽略该问题。来自 the MSI documentation :

If a substring of the form [!filekey] is found, it is replaced by the full short path of the file, with the value filekey used as a key into the File table. This syntax is valid only when used in the Value column of the Registry or the IniFile tables. When used in other columns this syntax is treated the same as [#filekey] .

换句话说,通过在实际未使用语法的情况下使用 [!...] 语法,编译器不会进行分析来处理警告[#...] 语法,但最终 MSI 仍将其视为该语法。您已经有效地从编译器中隐藏了该格式化字符串。

  • 理论理想:使用宣传的快捷方式,例如the blog article由您的其他答案引用。显然,这仅在快捷方式中的引用生成警告时有效。 :) 当然,使用宣传的快捷方式会带来其他复杂性。但这是一个选项,可以消除警告(因为在这种情况下您甚至没有使用 Target 属性,并且没有格式化字符串)。

关于xml - Wix - ICE60 和 ICE69 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21320334/

有关xml - Wix - ICE60 和 ICE69 警告的更多相关文章

  1. ruby-on-rails - 如何从 format.xml 中删除 <hash></hash> - 2

    我有一个对象has_many应呈现为xml的子对象。这不是问题。我的问题是我创建了一个Hash包含此数据,就像解析器需要它一样。但是rails自动将整个文件包含在.........我需要摆脱type="array"和我该如何处理?我没有在文档中找到任何内容。 最佳答案 我遇到了同样的问题;这是我的XML:我在用这个:entries.to_xml将散列数据转换为XML,但这会将条目的数据包装到中所以我修改了:entries.to_xml(root:"Contacts")但这仍然将转换后的XML包装在“联系人”中,将我的XML代码修改为

  2. ruby - 在院子里用@param 标签警告 - 2

    我试图使用yard记录一些Ruby代码,尽管我所做的正是所描述的here或here#@param[Integer]thenumberoftrials(>=0)#@param[Float]successprobabilityineachtrialdefinitialize(n,p)#initialize...end虽然我仍然得到这个奇怪的错误@paramtaghasunknownparametername:the@paramtaghasunknownparametername:success然后生成的html看起来很奇怪。我称yard为:$yarddoc-mmarkdown我做错了什么?

  3. ruby-on-rails - active_admin 目录中的常量警告重新声明 - 2

    我正在使用active_admin,我在Rails3应用程序的应用程序中有一个目录管理,其中包含模型和页面的声明。时不时地我也有一个类,当那个类有一个常量时,就像这样:classFooBAR="bar"end然后,我在每个必须在我的Rails应用程序中重新加载一些代码的请求中收到此警告:/Users/pupeno/helloworld/app/admin/billing.rb:12:warning:alreadyinitializedconstantBAR知道发生了什么以及如何避免这些警告吗? 最佳答案 在纯Ruby中:classA

  4. ruby-on-rails - 启动 Rails 服务器时 ImageMagick 的警告 - 2

    最近,当我启动我的Rails服务器时,我收到了一长串警告。虽然它不影响我的应用程序,但我想知道如何解决这些警告。我的估计是imagemagick以某种方式被调用了两次?当我在警告前后检查我的git日志时。我想知道如何解决这个问题。-bcrypt-ruby(3.1.2)-better_errors(1.0.1)+bcrypt(3.1.7)+bcrypt-ruby(3.1.5)-bcrypt(>=3.1.3)+better_errors(1.1.0)bcrypt和imagemagick有关系吗?/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ru

  5. ruby - 无法在 60 秒内获得稳定的 Firefox 连接 (127.0.0.1 :7055) - 2

    我使用的是Firefox版本36.0.1和Selenium-Webdrivergem版本2.45.0。我能够创建Firefox实例,但无法使用脚本继续进行进一步的操作无法在60秒内获得稳定的Firefox连接(127.0.0.1:7055)错误。有人能帮帮我吗? 最佳答案 我遇到了同样的问题。降级到firefoxv33后一切正常。您可以找到旧版本here 关于ruby-无法在60秒内获得稳定的Firefox连接(127.0.0.1:7055),我们在StackOverflow上找到一个类

  6. ruby-on-rails - 我更新了 ruby​​ gems,现在到处都收到解析树错误和弃用警告! - 2

    简而言之错误:NOTE:Gem::SourceIndex#add_specisdeprecated,useSpecification.add_spec.Itwillberemovedonorafter2011-11-01.Gem::SourceIndex#add_speccalledfrom/opt/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91./opt/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/gem_dependency.rb:275:in`==':und

  7. ruby-on-rails - 如何在 Rails 3 中禁用 XML 解析 - 2

    我想禁用HTTP参数的自动XML解析。但我发现命令仅适用于Rails2.x,它们都不适用于3.0:config.action_controller.param_parsers.deleteMime::XML(application.rb)ActionController::Base.param_parsers.deleteMime::XMLRails3.0中的等价物是什么? 最佳答案 根据CVE-2013-0156的最新安全公告你可以将它用于Rails3.0。3.1和3.2ActionDispatch::ParamsParser::

  8. ruby - 如何使用 Nokogiri::XML::Builder 生成动态标签? - 2

    我正在遍历数组中的一组标签名称,我想使用构建器打印每个标签名称,而不是求助于“我认为:builder=Nokogiri::XML::Builder.newdo|xml|fortagintagsxml.tag!tag,somevalendend会这样做,但它只是创建名称为“tag”的标签,并将标签变量作为元素的文本值。有人可以帮忙吗?这个看起来应该比较简单,我刚刚在搜索引擎上找不到答案。我可能没有以正确的方式提问。 最佳答案 尝试以下操作。如果我没记错的话,我添加了一个根节点,因为Nokogiri需要一个。builder=Nokogi

  9. ruby - 如何让 Nokogiri 解析并返回 XML 文档? - 2

    这是一些奇怪的例子:#!/usr/bin/rubyrequire'rubygems'require'open-uri'require'nokogiri'print"withoutread:",Nokogiri(open('http://weblog.rubyonrails.org/')).class,"\n"print"withread:",Nokogiri(open('http://weblog.rubyonrails.org/').read).class,"\n"运行此返回:withoutread:Nokogiri::XML::Documentwithread:Nokogiri::

  10. ruby - 模式加载时出现 Nokogiri::XML::Schema SyntaxError - 2

    我正在尝试加载SAML协议(protocol)架构(具体来说:https://www.oasis-open.org/committees/download.php/3407/oasis-sstc-saml-schema-protocol-1.1.xsd),但在执行此操作之后:schema=Nokogiri::XML::Schema(File.read('saml11_schema.xsd'))我得到这个输出:Nokogiri::XML::SyntaxErrorException:Element'{http://www.w3.org/2001/XMLSchema}element',att

随机推荐