Подтвердить что ты не робот

Как установить шрифты Open Type с помощью Wix

Я хочу установить набор шрифтов Open Type как часть моего msi istallation, я использую Wix для создания msi.

Любые советы?

4b9b3361

Ответ 1

Вам нужно указать каталог FontsFolder и установить атрибут TrueType в файле:

<DirectoryRef Id="FontsFolder">
  <Component Id="MyFontsFonts" Guid="...">
    <File Id="font1.ttf" Source="font1.ttf" TrueType="yes" />
    <File Id="font2.ttf" Source="font2.ttf" TrueType="yes" />
  </Component>
</DirectoryRef>

Ответ 2

Я не мог понять DirectoryRef - может быть, что-то изменилось за эти годы, но я плюхнул Directory в свой корень TARGETDIR и заставил его работать. В моем случае мне нужен Arial Narrow Bold на сервере:

<Directory Id="TARGETDIR" Name="SourceDir">
   <!-- snip ... all my other stuff here -->
   <Directory Id="FontsFolder">
     <Component Id="ComponentFontArialNarrowBold" Guid="{65F4712A-EAA6-4801-9200-212A3593D6E2}">
       <File Id="FileFontArialNarrowBold" Source="$(var.SolutionDir)Res\Fonts\ARIALNB.TTF" TrueType="yes" KeyPath="yes" />
     </Component>
   </Directory>
</Directory>

Ответ 3

Для установки шрифтов вы должны установить две части в своих кодах:

  <Feature Id="ProductFeature" Title="WixSetup" Level="1">
      <ComponentGroupRef Id="ProductComponents" />
      <ComponentRef Id="ApplicationShortcut" />
      <ComponentRef Id="ApplicationShortcutDesktop" />
      <ComponentRef Id="MyFontsFonts" />
  </Feature> 
.
.
.

<Directory Id="TARGETDIR" Name="SourceDir">                  
.
.
.
   <Directory Id="FontsFolder">
        <Component Id="MyFontsFonts" Guid="myGuid">
           <File Id="font1.ttf" Source="Fonts\font1.ttf" TrueType="yes" />
        </Component>
   </Directory>

</Directory>