Jump to content

Recommended Posts

InstallFontsTool x86
tabdownload.png Update (24 October 2013)
tabdownload.png Update (24 October 2013)
tabdownload.png Update (24 October 2013)
tabdownload.png Update (24 October 2013)
tabdownload.png Update (24 October 2013)
tabdownload.png Update (24 October 2013)
tabdownload.png Update (24 October 2013)
Hash MD5 BDB73A5921AB06BD9F6C3B56A46C218D
Filesize: 412 KB (421888 bytes)


InstallFontsTool x64
tabdownload.png Update (24 October 2013)
tabdownload.png Update (24 October 2013)
tabdownload.png Update (24 October 2013)
tabdownload.png Update (24 October 2013)
tabdownload.png Update (24 October 2013)
tabdownload.png Update (24 October 2013)
tabdownload.png Update (24 October 2013)
Hash MD5 D41D375A2EC052250FAEDD6DFC194CC1
Filesize: 444 KB (455168 bytes)


This tool allows you to easily install in your Windows NT6.x image (Vista/7/8/8.1) in unattended mode your personal fonts

Regline examples:
"InstallFontsTool.exe" "lokicola.ttf" "Loki Cola (TrueType)"
"InstallFontsTool.exe" "lokicola.ttf"
"InstallFontsTool.exe" "*.ttf"
With the following command line the tool searches for font files in FontDir directory and all subdirectories:
"InstallFontsTool.exe" "FontDir"

All file and directory path shown in command line must be present in same directory of InstallFontsTool.exe, as it serches for "File\Folder" inside its working directory. Otherwise you must use a command like this:
"InstallFontsTool.exe" "%UserProfile%\Desktop\FontDir"
or
"InstallFontsTool.exe" "%UserProfile%\Desktop\lokicola\lokicola.ttf"
Source code:
 
#RequireAdminGlobal Const $HWND_BROADCAST = 0xFFFFGlobal Const $WM_FONTCHANGE = 0x1DGlobal $aRet, $hGdi32 = DllOpen("gdi32.dll")Global $SourceFile, $FontDescript, $sDir, $sFilter, $aDirFilter;_InstallFontEx(@DesktopDir & "\SourceCodePro-ExtraLight.otf");_InstallFontEx(@DesktopDir & "\lokicola\lokicola.ttf", "Loki Cola (TrueType)")If $CmdLine[0] > 0 Then   For $Count = 1 To $CmdLine[0]      $sDir = $CmdLine[$Count]      If StringInStr($sDir, "*", 1) Then         $sFilter = StringRegExpReplace($sDir, ".*[\/\\]+", "")         $aDirFilter = StringRegExp($sDir, "(.+[^\/\\])([^\/\\]+)", 1)         If Not @Error Then            $sDir = $aDirFilter[0]            $sFilter = $aDirFilter[1]            If Not StringRegExp($aDirFilter[0], "^\h*(?:\\\\\?\\)*(\\\\[^\?\/\\]+|[A-Za-z]:)") Then $sDir = @ScriptDir & "\" & $aDirFilter[0]         Else            $sDir = @ScriptDir         EndIf         $SourceFile = _FileListToArrayEx($sDir, $sFilter, 13)         If Not @Error Then            For $y = 1 To $SourceFile[0]               _InstallFontEx($SourceFile[$y])            Next         EndIf      Else         If Not StringRegExp($sDir, "^\h*(?:\\\\\?\\)*(\\\\[^\?\/\\]+|[A-Za-z]:)") Then $sDir = @ScriptDir & "\" & $CmdLine[$Count]         If StringInStr(FileGetAttrib($sDir), "D", 1) Then            $SourceFile = _FileListToArrayEx($sDir, "(?:\.fon$|\.ttf$|\.ttc$|\.fot$|\.otf$|\.mmm$|\.pfb$|\.pfm$|\.pfb$)", 77)            If Not @Error Then               For $y = 1 To $SourceFile[0]                  _InstallFontEx($SourceFile[$y])               Next            EndIf         Else            If $CmdLine[0] > $Count And StringRegExp($CmdLine[$Count + 1], "\(.+\)") Then               $FontDescript = $CmdLine[$Count + 1]               $Count += 1            EndIf            _InstallFontEx($sDir, $FontDescript)         EndIf      EndIf   NextElse   MsgBox(0, "Error", "Please drop files to this script to run it!" & @LF & 'example : InstallFontsTool.exe "FontsName.ttf" "Fonts Desc"')EndIfDllClose($hGdi32); #FUNCTION# ====================================================================================================================; Name...........: _InstallFontEx; Description ...: Install a Font file; Syntax.........: _InstallFontEx($sFilePath); Parameters ....: $sFilePath     - The full path file;                  $sFontDescript - Optional, Font Description;                  $sFontsPath    - Optional, Font Path Destination; Return values .: Success - Title Property; Author ........: DXRW4E; ===============================================================================================================================Func _InstallFontEx($sFilePath, $sFontDescript = "", $sFontsPath = "")    If Not $sFontsPath Then $sFontsPath = @WindowsDir & "\Fonts"   Local $sFontsName = StringRegExpReplace($sFilePath, "\A.+[\/\\]+", "")    If Not FileCopy($sFilePath, $sFontsPath & "\" & $sFontsName, 1) Then Return SetError(1, 0, 0)   $aGdi32 = DllCall($hGdi32, "Int", "AddFontResource", "str", $sFontsPath & "\" & $sFontsName)   If @Error Or Not $aGdi32[0] Then Return SetError(1, 0, 0)   If Not $sFontDescript Then      ;;$aGdi32 = DllCall($hGdi32, "int", "GetFontResourceInfoW", "wstr", $sFontsPath & "\" & $sFontsName, "dword*", 4096, "wstr", "", "dword", 1)      ;;$sFontDescript = $aGdi32[3] & _FontGetProperty($sFilePath, 1)      $sFontDescript &= _FontGetProperty($sFilePath)   EndIf   RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts", $sFontDescript, "REG_SZ", $sFontsName)    DllCall("user32.dll", "Int", "SendMessage", "hwnd", $HWND_BROADCAST, "int", $WM_FONTCHANGE, "int", 0, "int", 0)    Return 1EndFunc; #FUNCTION# ====================================================================================================================; Name...........: _FontGetProperty; Description ...: Returns a property for a Font file; Syntax.........: _FontGetProperty($sFilePath); Parameters ....: $sFilePath  - The full path file; Return values .: Success - Title Property; Author ........: DXRW4E; ===============================================================================================================================Func _FontGetProperty($sFilePath, $iFlags = 0)    ;$sFilePath = StringRegExpReplace($sFilePath, '["' & "]", "")    If Not FileExists($sFilePath) Then Return SetError(1, 0, "")    Local $sTitle, $objFolder, $objFolderItem, $objShell = ObjCreate("Shell.Application")    If @Error Then Return SetError(3, 0, "")   $objFolder = $objShell.NameSpace(StringRegExpReplace($sFilePath, "\A.+\K[\/\\][^\/\\]*$", ""))    $objFolderItem = $objFolder.Parsename(StringRegExpReplace($sFilePath, "\A.+[\/\\]+", ""))   If Not $iFlags Then      $sTitle = $objFolder.GetDetailsOf($objFolderItem, 21)      If Not $sTitle Then Return SetError(2, 0, 0)   EndIf   If StringRegExp($objFolder.GetDetailsOf($objFolderItem, 187), "(?:True|Open)Type") Then $sTitle &= " (TrueType)"    Return $sTitleEndFunc   ;==>_FontGetProperty; #FUNCTION# =======================================================================================================================================================; Name...........: _FileListToArrayEx; Description ...: Lists files and\or folders in a specified path (Similar to using Dir with the /B Switch); Syntax.........: _FileListToArrayEx($sPath[, $sFilter = "*"[, $iFlag = 0]]); Parameters ....: $sPath   - Path to generate filelist for.;                  $sFilter - Optional the filter to use, default is *. (Multiple filter groups such as "All "*.png|*.jpg|*.bmp") Search the Autoit3 helpfile for the word "WildCards" For details.;                  $iFlag   - Optional: specifies whether to return files folders or both Or Full Path (add the flags together for multiple operations):;                  |$iFlag = 0 (Default) Return both files and folders;                  |$iFlag = 1 Return files only;                  |$iFlag = 2 Return Folders only;                  |$iFlag = 4 Search SubDirectory;                  |$iFlag = 8 Return Full Path;                  |$iFlag = 16 $sFilter do Case-Sensitive matching (By Default $sFilter do Case-Insensitive matching);                  |$iFlag = 32 Disable the return the count in the first element - effectively makes the array 0-based (must use UBound() to get the size in this case).;                    By Default the first element ($array[0]) contains the number of file found, the remaining elements ($array[1], $array[2], etc.);                  |$iFlag = 64 $sFilter is REGEXP Mod, See Pattern Parameters in StringRegExp (Can not be combined with flag 16);                  |$iFlag = 128 Return Backslash at the beginning of the file name, example Return "\Filename1.xxx" (Can not be combined with flag 8); Return values .: Failure - @Error;                  |1 = Path not found or invalid;                  |2 = Invalid $sFilter;                  |3 = No File(s) Found; Author ........: DXRW4E; Modified.......:; Remarks .......: The array returned is one-dimensional and is made up as follows:;                                $array[0] = Number of Files\Folders returned;                                $array[1] = 1st File\Folder;                                $array[2] = 2nd File\Folder;                                $array[3] = 3rd File\Folder;                                $array[n] = nth File\Folder; Related .......:; Link ..........:; Example .......: Yes; Note ..........: Special Thanks to SolidSnake & Tlem; ==================================================================================================================================================================Func _FileListToArrayEx($sPath, $sFilter = "*", $iFlag = 0)    $sPath = StringRegExpReplace($sPath & "\", "(?!\A)[\\/]+\h*", "\\")    If Not FileExists($sPath) Then Return SetError(1, 1, "")   If StringRegExp($sFilter, StringReplace('^\s*$|\v|[\\/:><"]|^\||\|\||\|$', "[" & Chr(BitAND($iFlag, 64) + 28) & '\/:><"]|^\||\|\||\|$', "\\\\")) Then Return SetError(2, 2, "")   Local $hSearch, $sFile, $sFileList, $sSubDir = BitAND($iFlag, 4), $sDelim = "|", $sDirFilter = StringReplace($sFilter, "*", "")    $hSearch = FileFindFirstFile($sPath & "*")    If @Error Then Return SetError(3, 3, "")   Local $hWSearch = $hSearch, $hWSTMP, $SearchWD, $Extended, $iFlags = StringReplace(BitAND($iFlag, 1) + BitAND($iFlag, 2), "3", "0")   If BitAND($iFlag, 8) Then $sDelim &= $sPath   If BitAND($iFlag, 128) Then $sDelim = "|\"   If Not BitAND($iFlag, 64) Then $sFilter = StringRegExpReplace(BitAND($iFlag, 16) & "(?i)(", "16\(\?\i\)|\d+", "") & StringRegExpReplace(StringRegExpReplace(StringRegExpReplace(StringRegExpReplace($sFilter, "[^*?|]+", "\\Q$0\\E"), "\\E(?=\||$)", "$0\$"), "(?<=^|\|)\\Q", "^$0"), "\*+", ".*") & ")"   While 1        $sFile = FileFindNextFile($hWSearch)        If @Error Then            If $hWSearch = $hSearch Then ExitLoop            FileClose($hWSearch)            $hWSearch -= 1            $SearchWD = StringLeft($SearchWD, StringInStr($SearchWD, "\", 1, -2))        ElseIf $sSubDir Then            $Extended = @Extended            If ($iFlags + $Extended <> 2) Then                If $sDirFilter Then                    If StringRegExp($sFile, $sFilter) Then $sFileList &= $sDelim & $SearchWD & $sFile                Else                    $sFileList &= $sDelim & $SearchWD & $sFile                EndIf            EndIf            If Not $Extended Then ContinueLoop            $hWSTMP = FileFindFirstFile($sPath & $SearchWD & $sFile & "\*")            If $hWSTMP = -1 Then ContinueLoop            $hWSearch = $hWSTMP            $SearchWD &= $sFile & "\"        Else            If ($iFlags + @Extended = 2) Or StringRegExp($sFile, $sFilter) = 0 Then ContinueLoop            $sFileList &= $sDelim & $sFile        EndIf    WEnd    FileClose($hSearch)    If Not $sFileList Then Return SetError(3, 3, "")   Return StringSplit(StringTrimLeft($sFileList, 1), "|", StringReplace(BitAND($iFlag, 32), "32", 2))EndFunc   ;==>_FileListToArrayEx 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Similar Content

    • By nonno fabio
      OnePiece Microsoft Silverlight v5.1.50907.0 True AddOn INTL
      Update (22 June 2017)
      Update (22 June 2017)
      Update (22 June 2017)
      Hash MD5 BA3494CA56A677AA8027F7D9512B2D97
      Filesize: 17.1 MB (17930897 bytes)
      compatible with Windows XP, Windows Server 2003 (needs latest versions of Nlite or RVM Integrator and Windows Vista/7 32/64 bit (needs latest version of DX WinNT6.x True Integrator)

      Onepiece's Silverlight is unistallable/reinstallable from Windows Components Wizard (it doesn't appear in Add/Remove Programs)

      XP:


      7:

    • By nonno fabio
      Onepiece's Microsoft .NET Framework 4.0 TRUE Addon for Windows XP, Windows 2003, Windows Vista x86 and Windows 7 x86
       
      OnePiece Microsoft.NET Framework v4.0.30319.2102 True AddOn ENU
      Update (22 June 2017)
      Update (22 June 2017)
      Update (22 June 2017)
      Hash MD5 F376A61FF77483BF04A748DCF160270F
      Filesize: 42.22 MB (44274780 bytes)  
      This DX WinNT6.x Integrator addon is compatible with Windows Vista and 7 x86 (32 bit) versions (for XP/2003 you must use latest releases of RVM Integrator or Nlite).
      The peculiarity of this addon is that .NET framework is directly slipstreamed into your Windows source, without the need of running .msi files or svcpack/runonce installations, a "true addon" integration just like .net 1.0 in Windows Server 2003.
      So you'll get a working .NET framework already installed BEFORE T-13 (svcpack time), a very handy opportunity.
      How to update the DotNet True AddOn
    • By OnePiece
      Ragazzi ecco come True AddOn anche il Microsoft Silverlight x32 & x64, il AddOn si Integra in Windows XP/2003 usando nLite & RVMi in x32 Mod (per chi vole provare integrarlo in WIndows 2000 allora serve usare il DXUPAC qui per creare il True AddOn del Silverlight per Win2k SP4), e in Windows NT6.x Vista/Seven usando il WinNT6.x True Integrator in x32 & x64 mod (secondo Windows dove si integrera)
       
       
      OnePiece Microsoft Silverlight v5.1.50901.0 True AddOn INTL
      Aggiornato (21 Dicembre 2016)
      Aggiornato (21 Dicembre 2016)
      Hash MD5 170A4BA56C83329B1A07FCED6628258F
      Filesize: 17.1 MB (17930127 bytes)  
    • By OnePiece
      Ragazzi ecco come True AddOn anche il Adobe Flash Player x32 & x64, il addon e applicabile in Windows XP (x32) e in Windows Vista\Seven\WCP\NEXT (x32 & x64) per integrare il addon in WIndows NT6.x Vista/Seven necessita usare ultima release del DX WinNT6.x True Integrator, invece come sempre in Windws XP serve usare nLite e RVMi
      Ragazzi serve installare ultima versione del Adobe Flash Player ActiveX, dopo scaricare e eseguire il
      Create OnePiece Adobe Flash Player True AddOn
      Aggiornato (11 Settembre 2014)
      Aggiornato (11 Settembre 2014)
      Aggiornato (11 Settembre 2014)
      Aggiornato (11 Settembre 2014)
      Aggiornato (11 Settembre 2014)
      Hash MD5 F58AD5AD3C67D4646074F713799E56DE
      Filesize: 117 KB (120085 bytes)

    • By OnePiece
      Ragazzi ecco come Ture AddOn il Microsoft.NET Framework 4 x32, il addon e applicabile in Windows 7 x32 e WinXP e Win2k3, non e stato testato in Windows Vista, ma normalmente dovrà essere più che Ok anche li, per integrare il addon in Windows Vista e Windows 7 necessita usare ultima release del WinNT6.x True Integrator, invece in WinXP e Win2k3 serve usare come sempre nLite e RVMi per integrarlo
       
       
      OnePiece Microsoft.NET Framework v4.0.30319.2091 True AddOn ENU
      Aggiornato (21 Dicembre 2016)
      Aggiornato (21 Dicembre 2016)
      Hash MD5 924E98A7D02CCE360FFFA78C07E1A03D
      Filesize: 42.19 MB (44237392 bytes)  
      Filesize: 42.32 MB (44370526 bytes)
      Come aggiornare DotNet True AddOn
×
×
  • Create New...