Sign in to follow this  
Followers 0
lafafmentvotre

Fonts install silently

5 posts in this topic

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

Share this post


Link to post
Share on other sites



Did you try using WinGetHandle for the window and changing its state?

Share this post


Link to post
Share on other sites

Hello Wayfarer

Thank you for your response

No,I've never used and I don't know how to use it for my problem

Share this post


Link to post
Share on other sites

use the info tool to get the title of that window, and search the help file for WinGetHandle and WinSetState.

P.S: It's Palestinian, not Wayfarer

Share this post


Link to post
Share on other sites

Thank you for help Palestinian and sorry for the wayfarer :-)

Share this post


Link to post
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
Sign in to follow this  
Followers 0