Installing a font without a reboot
Hi
Have anyone made a package which installs a font and made the font usable without doing a reboot first?
Somehow the font is not avalible for the user until a reboot is made.
Here is what my package does.
It install the font to %Windir%\fonts
Also adding a reg entry for the font
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
"Akbar Plain (TrueType)"="akbar.ttf"
Have anyone made a package which installs a font and made the font usable without doing a reboot first?
Somehow the font is not avalible for the user until a reboot is made.
Here is what my package does.
It install the font to %Windir%\fonts
Also adding a reg entry for the font
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
"Akbar Plain (TrueType)"="akbar.ttf"
0 Comments
[ + ] Show comments
Answers (7)
Please log in to answer
Posted by:
anonymous_9363
15 years ago
I was until recently of the opinion that the 'Fonts' table route was sufficient. Not so. I had to resort to a scripted install for 2 TrueType and 2 Type 1 fonts (the PFMs). Here's the script. Note that much of the error-trapping has been removed to make it more readable here:
Option Explicit
Dim objFSO
Dim objShell
Dim objShellApp
Dim objFontsFolder
Dim strWindowsFolder
Dim strTempFolder
Dim strFiles
Dim strFileName
Dim strFile
Dim arrFiles
Dim intIndex
Const intSpecialFolderFonts = &H14&
Const intNoProgressDialog = 4
Const intNoUIOnError = 1024
'// Apparently, using the special folder FONTS is the only programmatic way of guaranteeing that fonts are fully "installed".
'// Simply copying them to the Windows\Fonts folder is no good.
Set objShell = CreateObject("Wscript.Shell")
Set objShellApp = CreateObject("Shell.Application")
Set objFontsFolder = objShellApp.Namespace(intSpecialFolderFonts)
Set objFSO = CreateObject("Scripting.FileSystemObject")
strWindowsFolder = objShell.ExpandEnvironmentStrings("%SystemRoot%")
strTempFolder = strWindowsFolder & "\TEMP"
strTempFolder = objShell.ExpandEnvironmentStrings("%TEMP%")
strFiles = ""
strFiles = strFiles & "MI______.PFM,"
strFiles = strFiles & "Micr013n.ttf,"
strFiles = strFiles & "OCRB10N.PFM,"
strFiles = strFiles & "ocrb10n2.TTF"
arrFiles = Split(strFiles, ",")
For intIndex = 0 To UBound(arrFiles)
strFileName = arrFiles(intIndex)
strFile = strWindowsFolder & "\FONTS\" & strFileName
If Not objFSO.FileExists(strFile) Then
objFontsFolder.CopyHere strTempFolder & "\" & strFileName, intNoProgressDialog + intNoUIOnError
End If
Next
Set objFontsFolder = Nothing
Set objShellApp = Nothing
Set objShell = Nothing
Set objFSO = Nothing
Posted by:
Inabus
15 years ago
Its easy, use the Font table in the MSI, for your example above you would do the following:
Component "Add Font"
Destination - [FontsFolder]
File - akbar.ttf
Direct Edit tables:
Font table
"File" - akbar.ttf
"Font Title" - Akbar Plain (TrueType)
Compile and install.
Done, no reboot required and the wonders of the MSI tables strikes again!
P
Component "Add Font"
Destination - [FontsFolder]
File - akbar.ttf
Direct Edit tables:
Font table
"File" - akbar.ttf
"Font Title" - Akbar Plain (TrueType)
Compile and install.
Done, no reboot required and the wonders of the MSI tables strikes again!
P
Posted by:
cygan
15 years ago
Have anyone made a package which installs a font and made the font usable without doing a reboot first
well you will still need a reboot anyway because the font will not work without the reboot
if this is as msi package then I guess you will need to REBOOT=ReallySuppress
and then get your users to reboot their pc's when they are ready to do so
Posted by:
Bankeralle
15 years ago
Its easy, use the Font table in the MSI, for your example above you would do the following:
Component "Add Font"
Destination - [FontsFolder]
File - akbar.ttf
Direct Edit tables:
Font table
"File" - akbar.ttf
"Font Title" - Akbar Plain (TrueType)
Compile and install.
Done, no reboot required and the wonders of the MSI tables strikes again!
This do not work. Thefont are not usuable before rebooting the computer
Im adding the font though the installation expert view- file table.
After adding the the file im switching to the setup editor view and changing the font table as you desribed. If you are doing it like this the fonts get registred but are not usuable before reboot. Pllease tell me if im doing something wrong
Component "Add Font"
Destination - [FontsFolder]
File - akbar.ttf
Direct Edit tables:
Font table
"File" - akbar.ttf
"Font Title" - Akbar Plain (TrueType)
Compile and install.
Done, no reboot required and the wonders of the MSI tables strikes again!
This do not work. Thefont are not usuable before rebooting the computer
Im adding the font though the installation expert view- file table.
After adding the the file im switching to the setup editor view and changing the font table as you desribed. If you are doing it like this the fonts get registred but are not usuable before reboot. Pllease tell me if im doing something wrong
Posted by:
Bankeralle
15 years ago
Thx for both help
I got it finally to work by using the method to Inabus. It did not work the first time i tried though:-)
All fonts had the xtension *.TTF
But what are you saying VBSCAB are you saying that the method to inabus do not always work for all fonts?
Anyway im giving 1 in rating to both of your posts
Thx for the help to both of you
I got it finally to work by using the method to Inabus. It did not work the first time i tried though:-)
All fonts had the xtension *.TTF
But what are you saying VBSCAB are you saying that the method to inabus do not always work for all fonts?
Anyway im giving 1 in rating to both of your posts
Thx for the help to both of you
Posted by:
anonymous_9363
15 years ago
are you saying that the method to inabus do not always work for all fonts?Up until last month, when I picked up a package from a colleague which installed a MICR TrueType font (used in cheque-printing), I hadn't ever thought twice about fonts. Stick 'em in the Fonts table, forget 'em. The 2 TT fonts for this package (CheckPrint v4.91, for the curious) would NOT be recognised by Windows when delivered by th epackage. Irritatingly, dragging-and-dropping the fonts worked every time.
In these situations, pragmatism (and client deadlines) looms large so the script was created. I'll keep it in my armoury in case I come across the situation again.
Posted by:
Selçuk DERE
8 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.