From 7ec699552de8de15e461507074620b297574dc99 Mon Sep 17 00:00:00 2001 From: mösi Date: Thu, 7 Mar 2013 06:36:32 +0000 Subject: Das Entpacken der gezippten Fontdatei für die Bildschirmtastatur wird jetzt mit Windows-Bordmitteln abgewickelt. Das macht die Verwendung von externen Unzip-Programmen unnötig. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.neo-layout.org@2436 b9310e46-f624-0410-8ea1-cfbb3a30dc96 --- windows/neo-vars/src/source/screenkeyboard.ahk | 61 +++++++++++++++++--------- 1 file changed, 41 insertions(+), 20 deletions(-) (limited to 'windows') diff --git a/windows/neo-vars/src/source/screenkeyboard.ahk b/windows/neo-vars/src/source/screenkeyboard.ahk index 389026e..de00f50 100644 --- a/windows/neo-vars/src/source/screenkeyboard.ahk +++ b/windows/neo-vars/src/source/screenkeyboard.ahk @@ -2,11 +2,6 @@ BSTalwaysOnTop := 1 -UnZipSFXSourceLink := "ftp://ftp.info-zip.org/pub/infozip/win32/unz600xn.exe" -UnZipSFXLocalFile := ResourceFolder . "\unzipsfx.exe" - -UnZipLocalFile := ResourceFolder . "\unzip.exe" - UniFontVersion := "2.33" UniFontFilename := "DejaVuSans-Bold.ttf" UniFontName := "DejaVu Sans" @@ -17,8 +12,8 @@ UniFontZipLocalFile := ResourceFolder . "\" . UniFontZipFilename UniFontZipSourceLink := "http://downloads.sourceforge.net/project/dejavu/dejavu/" . UniFontVersion . "/" . UniFontZipFilename UniFontLocalFilePath := ApplicationFolder -UniFontLocalFile := UniFontLocalFilePath . "/" . UniFontFilename -UniFontZipFontPath := "dejavu-fonts-ttf-" . UniFontVersion . "/ttf/" . UniFontFilename +UniFontLocalFile := UniFontLocalFilePath . "\" . UniFontFilename +UniFontZipFontPath := "dejavu-fonts-ttf-" . UniFontVersion . "\ttf\" . UniFontFilename Check_BSTUpdate(DoBSTUpdate = 0) { global @@ -192,6 +187,11 @@ CharProc__BST0() { DllCall( "GDI32.DLL\RemoveFontResourceEx", Str, UniFontLocalFile ,UInt,(FR_PRIVATE:=0x10), Int,0) } +Copy_Async(sourcefile, destpath) +{ + ComObjCreate("Shell.Application").Namespace(destpath).CopyHere(sourcefile,4|16) +} + CharProc__BST1() { global if (GuiCurrent!="") @@ -205,24 +205,45 @@ CharProc__BST1() { Msgbox, 4, NeoVars-Bildschirmtastatur, Wollen Sie die für die Bildschirmtastatur notwendigen Dateien herunterladen? ifMsgBox, No Return - if (FileExist(UnZipLocalFile)=="") { - Progress,0,Herunterladen des gepackten Entpack-Programms ... - UrlDownloadToFile,%UnZipSFXSourceLink%,%UnZipSFXLocalFile% - if (FileExist(UnZipSFXLocalFile)=="") { - Msgbox,Konnte Unzip-Programm nicht finden und nicht installieren! - } else { - Progress,25,Entpacken des Entpack-Programms ... - RunWait,% """" . UnZipSFXLocalFile . """ -d """ . ResourceFolder . """ unzip.exe",,Hide - } - } + Progress,0,Herunterladen der gepackten Font-Datei ... if (FileExist(UniFontZipLocalFile)=="") { - Progress,50,Herunterladen des Fonts ... UrlDownloadToFile,%UniFontZipSourceLink%,%UniFontZipLocalFile% } - Progress,75,Entpacken des Archivs ... - RunWait,% """" . UnZipLocalFile . """ -j """ . UniFontZipLocalFile . """ """ . UniFontZipFontPath . """",%UniFontLocalFilePath%,Hide + if (FileExist(UniFontZipLocalFile)=="") { + Progress,100,Fehler. Konnte gepackte Font-Datei nicht herunterladen. + return + } + + Progress,50,Entpacken des Archivs ... + Copy_Async(UniFontZipLocalFile . "\" . UniFontZipFontPath, UniFontLocalFilePath) + i := 0 + loop { + Progress,% 50+i,Entpacken des Archivs ... + sleep 200 + if (FileExist(UniFontLocalFile)!="") { + Progress,75,Fertig + break + } + i := i+1 + if (i > 20) { + Progress,100,Fehler + sleep 500 + break + } + } + ; 4 Sekunden sollten reichen. Wenn nicht, Abbruch. + if (FileExist(UniFontLocalFile)=="") { + Progress,OFF + MsgBox,Font-Datei %UniFontLocalFile% existiert nicht. Abbruch. + return + } + Progress,90,Entferne Archiv-Datei ... + FileDelete,%UniFontZipLocalFile% + Sleep,200 + Progress,100,Fertig! + Sleep,2000 Progress,OFF } -- cgit v1.2.3