Platform SDK: Installing Applications/Setup |
By carrying out these steps, you can write a single font installation routine that works for both Windows NT/Windows 2000 and Windows 95/98:
If you use the installer, fonts are registered automatically.
HKeyLocalMachine\Software\Microsoft\Windows\CurrentVersion\Setup
The data value of "SharedDir" is the UNC name of the server and sharepoint of the shared directory. In most cases, a shared directory is marked as read-only by the system administrator, so your installation program should also check to see if it can write to this location. If it cannot, it should let the user install the fonts in a different location, or stop the setup process.
HKeyLocalMachine\Software\Microsoft\Windows\CurrentVersion\Fonts
For Windows NT/Windows 2000, the font name is stored in the following registry location.
HKeyLocalMachine\Software\Microsoft\Windows NT\CurrentVersion\Fonts
The subkeys in this registry location contain the full name of the font file as the value key, followed by the filename of the .TTF file as the key data. If the filename in the registry is just a filename with no path information, the font is installed in the \WINDOWS\FONTS directory for Windows 95/98 or the \WINDOWS\SYSTEM directory for Windows NT/Windows 2000. Because TrueType font files do not carry a version resource, your program will need to retrieve the version string from the 'name' table in the .TTF file.
HKeyLocalMachine\Software\Microsoft\Windows\CurrentVersion\Fonts