How to install Open Type Fonts using Wix

后端 未结 3 1357
慢半拍i
慢半拍i 2020-12-11 14:50

I want to install a set of Open Type Fonts as part of my MSI installation. I am using Wix to create the MSI.

Any advice?

相关标签:
3条回答
  • 2020-12-11 15:31

    I couldn't figure out DirectoryRef—maybe something has changed over the years—but I plopped a Directory in my root TARGETDIR and got it to work. In my case, I needed Arial Narrow Bold on the server:

    <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>
    
    0 讨论(0)
  • 2020-12-11 15:34

    You need to specify the directory FontsFolder, and set the TrueType attribute on the file:

    <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>
    
    0 讨论(0)
  • 2020-12-11 15:47

    For install fonts you must set two parts in your codes:

      <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>
    
    0 讨论(0)
提交回复
热议问题