Font Installtion
Font Installtion
How do I install a custom font on the target system?
Copying does not work,
I read this in the winodws installer documentation:
Windows Installer
Font Table
The Font table contains the information for registering font files with the system.
The Font table has the following columns.
Column Type Key Nullable
File_ Identifier Y N
FontTitle Text Y
Columns
File_
External key into the File table entry for the font file. It is recommended that the component containing the font file have the FontsFolder specified in the Directory_ column of the Component table.
FontTitle
Font name. It is recommended that you leave this column null for TrueType Fonts and TrueType Collections because the installer can register the font after reading the correct font title from the font file. If the font name is entered, it must be identical to font title from the font file. You must specify a title for fonts that do not have embedded names, such as .fon files.
Remarks
This table is referred to when the RegisterFonts action or the UnregisterFonts action is executed.
If the FontTitle field is left Null, the Font name is read directly from the font file specified. If the font name recorded into the FontTitle field differs from the internal font name recorded in the font file, the font is registered twice by the RegisterFonts action.
Font files should not be authored with a language ID, as fonts do not have an embedded language ID resource.Thus the Language column of the File table should be left null for font files.
Because the installer does not refcount font files by default, preexisting font files may be removed with their component when uninstalling an application. To ensure that a font file is not removed, authors may set the msidbComponentAttributesSharedDllRefCount or msidbComponentAttributesPermanent bit flags in the Attributes column of the Component Table_msi_Component_Table for the component containing the font file.
It seems that windows installer has a method for this, can this functionality be exposed?
I read this in the winodws installer documentation:
Windows Installer
Font Table
The Font table contains the information for registering font files with the system.
The Font table has the following columns.
Column Type Key Nullable
File_ Identifier Y N
FontTitle Text Y
Columns
File_
External key into the File table entry for the font file. It is recommended that the component containing the font file have the FontsFolder specified in the Directory_ column of the Component table.
FontTitle
Font name. It is recommended that you leave this column null for TrueType Fonts and TrueType Collections because the installer can register the font after reading the correct font title from the font file. If the font name is entered, it must be identical to font title from the font file. You must specify a title for fonts that do not have embedded names, such as .fon files.
Remarks
This table is referred to when the RegisterFonts action or the UnregisterFonts action is executed.
If the FontTitle field is left Null, the Font name is read directly from the font file specified. If the font name recorded into the FontTitle field differs from the internal font name recorded in the font file, the font is registered twice by the RegisterFonts action.
Font files should not be authored with a language ID, as fonts do not have an embedded language ID resource.Thus the Language column of the File table should be left null for font files.
Because the installer does not refcount font files by default, preexisting font files may be removed with their component when uninstalling an application. To ensure that a font file is not removed, authors may set the msidbComponentAttributesSharedDllRefCount or msidbComponentAttributesPermanent bit flags in the Attributes column of the Component Table_msi_Component_Table for the component containing the font file.
It seems that windows installer has a method for this, can this functionality be exposed?
Please paste this code into your setup script - it contains the necessary API calls to register (and, optionally unregister) a font that has been copied over.
Code: Select all
~InstallAWARE Clipboard Data~
~Call DLL Function~
~{12574AA8-AF82-4E0B-86BB-1B5559164412}~
~gdi32.dll,RemoveFontResourceA,bool,,"pointer to string",$TARGETDIR$\\font.ttf,$~
~mIDEFunc.dll\\mEXEFunc.dll~
~Comment~
~{D716ED65-395B-488D-9DAB-A9BF18864D53}~
~Remove Font File~
~Call DLL Function~
~{48537E1C-E3F3-4F71-B09E-7F9754079EC0}~
~user32.dll,SendMessageA,long,,"double word",4294967295,"double word",29,"double word",0,"double word",0,$~
~mIDEFunc.dll\\mEXEFunc.dll~
~Comment~
~{361C97BD-6316-4EBC-A7B4-16C1D9215DF7}~
~Send WM_FONTCHANGE Message~
~Call DLL Function~
~{909CB40B-4E18-48D7-B3D7-A9B4209A04D3}~
~gdi32.dll,AddFontResourceA,long,,"pointer to string",$TARGETDIR$\\fontfile.ttf,$~
~mIDEFunc.dll\\mEXEFunc.dll~
~Comment~
~{444DD43F-C304-452B-9A71-FD416C2AF57F}~
~Add Font File~
I think you would only unregister during an uninstall, before Apply Uninstall is called, to deregister the fonts from the system.
And, you would register each font (or unregister each font), and then you would call the Send Message WinAPI at the end of the entire (un)registration sequence, to broadcast to applications the font table changes.
Thanks for your kind words - please help spread the word on InstallAware!
And, you would register each font (or unregister each font), and then you would call the Send Message WinAPI at the end of the entire (un)registration sequence, to broadcast to applications the font table changes.
Thanks for your kind words - please help spread the word on InstallAware!
Plugin for font installation available
Hi,
I developed a plugin for easy and save font installation (Freeware!). More information is available here: http://www.installaware.com/forum/viewtopic.php?t=480.
cu
Markus
I developed a plugin for easy and save font installation (Freeware!). More information is available here: http://www.installaware.com/forum/viewtopic.php?t=480.
cu
Markus
Who is online
Users browsing this forum: Google [Bot] and 114 guests