Jump to content

Fonts install silently


Recommended Posts

Hi everybody

Is there a solution to execute this script without "Installing Fonts" window ?

140327020911725766.png

#region AUTOIT VARIABLES
#endregion
#region DIRECTORY & DRIVERS
DirCreate(@TempDir&'\Perpetua_Fonts')
FileInstall('Sources\PerpetuaMTPro.otf', @TempDir&'\Perpetua_Fonts\PerpetuaMTPro.otf')
FileInstall('Sources\PerpetuaMTPro-Bold.otf', @TempDir&'\Perpetua_Fonts\PerpetuaMTPro-Bold.otf')
FileInstall('Sources\PerpetuaMTPro-BoldItalic.otf', @TempDir&'\Perpetua_Fonts\PerpetuaMTPro-BoldItalic.otf')
FileInstall('Sources\PerpetuaMTPro-Italic.otf', @TempDir&'\Perpetua_Fonts\PerpetuaMTPro-Italic.otf')
FileInstall('Sources\PerpetuaTitlingMTPro.otf', @TempDir&'\Perpetua_Fonts\PerpetuaTitlingMTPro.otf')
FileInstall('Sources\PerpetuaTitlingMTPro-Bold.otf', @TempDir&'\Perpetua_Fonts\PerpetuaTitlingMTPro-Bold.otf')
FileInstall('Sources\PerpetuaTitlingMTPro-Light.otf', @TempDir&'\Perpetua_Fonts\PerpetuaTitlingMTPro-Light.otf')
#endregion
#region SCRIPT VARIABLES
Const $FONTS = 0x14
$oShell=ObjCreate("Shell.Application")
$oWinFonts=$oShell.Namespace($FONTS)
$sFirstFile=FileFindFirstFile(@TempDir&'\Perpetua_Fonts\*.*')
#endregion
#region SCRIPT
If $sFirstFile=-1 Then
Exit
EndIf
While 1
Local $sFile = FileFindNextFile($sFirstFile)
If @error Then ExitLoop
Switch StringRight($sFile, 3)
Case 'ttf', 'otf', 'pfm', 'fon'
$sWinFontsPath = @WindowsDir&'\fonts\'&$sFile
$sLocFontsPath = @TempDir&'\Perpetua_Fonts\'&$sFile
If NOT FileExists($sWinFontsPath) Then
$oWinFonts.CopyHere($sLocFontsPath)
Else
;~ MsgBox(262144, $sFile, 'The file is already installed', 1)
EndIf
EndSwitch
WEnd
DirRemove(@TempDir&'\Perpetua_Fonts',1)
#endregion

Thanks and sorry for my english

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...