Difference between revisions of "Fonts"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
m
Line 1: Line 1:
'''This did not work as the fonts are not registered in registry.
+
This is a silent installer for distributing additional fonts.
When you have Administrator rights and open the %WINDIR%\Fonts\ directory after copying the fonts you wont notice that, as the new fonts get registered automaticely then by Windows Explorer.'''
+
Always be sure to be entitled to use the fonts you are distributing.
  
----
 
  
 +
To install new fonts on a Windows machine, you have to do two things:
  
This is a silent installer for distributing additional fonts.
+
* copy the font file to <code>%WINDIR%\Fonts\</code> directory,
Always be sure to be entitled to use the fonts you are distributing.
+
* add a registry entry.
  
Not sure how it behaves when a font is already installed on the client.
 
<source lang="xml">
 
<package id="additional-fonts" name="Additional fonts" revision="1" reboot="false" priority="950" execute="once">
 
  
  <install cmd='%COMSPEC% /c copy /Y "%SOFTWARE%\Fonts\*.TTF " "%WINDIR%\Fonts\" ' />
 
  
</package>
+
== example batch file ==
 +
 
 +
An example bat file will look like this:
 +
 
 +
<source lang="dos">
 +
%COMSPEC% /c copy /Y "%SOFTWARE%\Fonts\*.TTF " "%WINDIR%\Fonts\^
 +
regedit /s "%SOFTWARE%\Fonts\add-fonts.reg"
 
</source>
 
</source>
  
A very simple Method to install Fonts is to create a minimalistic Setup-Package with INNO-Setup, where you can add all the Font's you want to install. The silent Setup installs and registers the Fontfiles during Installation
+
== example registry file ==
  
Or you can use a registry file like this
+
An example registry file will look like this:
<pre>
+
<source lang="reg">
 
Windows Registry Editor Version 5.00
 
Windows Registry Editor Version 5.00
  
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
"<font name>"="<font file name>"
+
"Frankfurt Gothic (TrueType)"="FRANKGON.TTF"
</pre>
+
</source>
Substitute "font name" with for example "Arial (TrueType)", and "font file name" with for example "arial.ttf".
+
 
 +
 
 +
== example XML file for WPKG ==
 +
 
 +
<source lang="xml">
 +
<package id="additional-fonts" name="Additional fonts" revision="1" reboot="false" priority="950" execute="once">
 +
 
 +
  <install cmd='"%SOFTWARE%\Fonts\add-fonts.bat"' />
 +
 
 +
</package>
 +
</source>
 +
 
 +
 
  
 
[[category:Silent Installers]]
 
[[category:Silent Installers]]
 +
[[Category: Changing Windows settings]]

Revision as of 12:03, 14 August 2009

This is a silent installer for distributing additional fonts. Always be sure to be entitled to use the fonts you are distributing.


To install new fonts on a Windows machine, you have to do two things:

  • copy the font file to %WINDIR%\Fonts\ directory,
  • add a registry entry.


example batch file

An example bat file will look like this:

%COMSPEC% /c copy /Y "%SOFTWARE%\Fonts\*.TTF " "%WINDIR%\Fonts\^
regedit /s "%SOFTWARE%\Fonts\add-fonts.reg"

example registry file

An example registry file will look like this:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
"Frankfurt Gothic (TrueType)"="FRANKGON.TTF"


example XML file for WPKG

<package id="additional-fonts" name="Additional fonts" revision="1" reboot="false" priority="950" execute="once">

  <install cmd='"%SOFTWARE%\Fonts\add-fonts.bat"' />

</package>