使用Wix安装字体而不是本地字体文件夹 [英] Installing a font with Wix not to the local font folder

查看:924
本文介绍了使用Wix安装字体而不是本地字体文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在添加字体时,WiX会选择.ttf扩展名,并要求您将其安装到本地Font文件夹(使用Directory Id =FontsFolder和TrueType =yes时)。如果您删除这些属性,它会翻倒。



有没有办法让WiX将字体安装到自定义文件夹(../ Content / fonts /)抱怨?

编辑:

 < Directory Id =dirFontsFolder Name =fonts> 
< Component Id =cfont.ttfGuid =BDEBACC8-D057-4406-87B9-B310BA6DFE27>
< File Id =font.ttfSource =$(var.SrcWebsite)\Content\fonts\font.ttfKeyPath =yes/>
< / Component>
< / Directory>

使用上面的代码,我得到错误:

错误LGHT1076:ICE60:font.ttf文件不是字体,其版本不是伴随文件的引用。它应该有一个语言列中指定的语言。

解决方案

在几个月后提出问题,我们设法找到问题:



KeyPath解决方案是答案的一半(请参阅Alex的答案)。如果不使用WiX中的KeyPath属性,下面的解决方案将不起作用。另一部分是WiX通过链接器(light.exe)运行的内部一致性评估器(ICE) )包装MSI时。 ICE规则ICE07检查文件的内容,如果它确定该文件是一种字体,将强制在Windows / Fonts中的文件。



停止这个发生时,您需要在light.exe运行时禁用此规则。为此,在light.exe之后添加-sice:参数。对于我们的例子来说:

  light.exe -sice:ICE07 

您可以通过添加更多的参数来禁用多个规则。


I am using Wix to create an installation for a website.

When adding a font, WiX picks up on the .ttf extension and requires you to install it to the local Font folder (When using a Directory Id="FontsFolder" and TrueType="yes"). If you remove these attributes, it falls over.

Is there a way to get WiX to install the fonts to a custom folder (../Content/fonts/) without complaining?

EDIT:

   <Directory Id="dirFontsFolder" Name="fonts">
       <Component Id="cfont.ttf" Guid="BDEBACC8-D057-4406-87B9-B310BA6DFE27">
           <File Id="font.ttf" Source="$(var.SrcWebsite)\Content\fonts\font.ttf" KeyPath="yes" />
       </Component>
   </Directory>

With the above code, I get the error:

error LGHT1076 : ICE60: The file font.ttf is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.

解决方案

After the issue being raised months later we managed to find the issue:

The KeyPath solution was half of the answer (See Alex's Answer). Without using the KeyPath attribute in WiX, the below solution will not work.

The other part is the Internal Consistency Evaluators (ICE) that WiX runs through Linker (light.exe) when packaging the MSI. The ICE rule ICE07, checks the contents of the files, and if it determines that the file is a font, will force the file in Windows/Fonts.

To stop this happening, you need to disable this rule when light.exe runs. To do this, you add the -sice: parameter after light.exe. For our example it would be:

light.exe -sice:ICE07

You can disable multiple rules by adding more -sice parameters.

这篇关于使用Wix安装字体而不是本地字体文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆