User Tools

Site Tools


userspace:etu_notepad

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

userspace:etu_notepad [2015/03/30 21:30]
Robert Tauber
userspace:etu_notepad [2021/08/23 08:37]
Line 1: Line 1:
-====== ETU Notepad++ ====== 
- 
-**Versions**\\ 
-Versions 
-By //[[tauber(at)fsmb.mw.tum.de|Robert Tauber]] 2015/03/13//\\ 
- 
- 
-Tested with opsi xxxxx\\ 
-requiredWinstVersion >= 4.11.4.12 //[[tauber(at)fsmb.mw.tum.de|Robert Tauber]] 2015/03/13//\\ 
- 
-Das Setup-File wird unter Q:\Notepad++\Notepad++\npp.#.#.#.Installer.exe bereit gestellt (den Speicher Ort des Netzlaufwerks Q: bestimmt die **map_Q.exe** //..\opt_pcbin\install\!drivemap\map_Q.exe//) 
- 
-Tree (..\opt_pcbin\install\!drivemap):\\ 
-[[map_Q.exe]]\\ 
- 
-Tree (Q:\Notepad++):\\ 
-Copy.exe\\ 
-Notepad++\npp.#.#.#.Installer.exe\\ 
- 
-Tree (..\notepadpp):\\ 
-OPSI\control\\ 
-CLIENT_DATA\setup.ins\\ 
-CLIENT_DATA\uninstall.ins\\ 
-CLIENT_DATA\image.png\\ 
- 
-um eine userDefinedLang vorzuinstalliren z.B. Syntax Highlighting für winst\\ 
-CLIENT_DATA\userDefineLang\notepad++.exe\\ 
-CLIENT_DATA\userDefineLang\userDefineLang.xml\\ 
- 
-==== Copy.exe / Copy.au3 ==== 
-Kopieren und Umbenennen \\ 
-//Später ermitteln der Version Nummer// 
- 
-<code autoit> 
-#include <File.au3> 
-#include <Array.au3> 
- 
-;RT: Wo binn ich / Wo sol es denn hin 
-Local $sPath = @ScriptDir 
-Local $aPath = StringSplit( @ScriptDir, "\" ) 
-Local $sPathTo = "C:\Temp\" & $aPath[$aPath[0]] ;RT: Zielordner auf dem Client 
-local $extention = ".exe" ;RT: welche Dateien sollen umbenannt werden *.exe 
- 
-;RT: Zur Kontrolle 
-;_ArrayDisplay($sFolderList, "$Folderolder") 
-;MsgBox ( 1, "Zeil Pfad", $sPathTo  ) 
- 
-;RT: Erstmal aufräumen 
-DirRemove ( $sPathTo , 1 ) 
- 
-;RT: Wie sehen meine Ordner aus 
-Local $sFolderList = _FileListToArray($sPath , "*" , 2 ) 
-local $i = 0 
- 
-;RT: Jetzt Ordner für ordner 
-For $i = 1 to $sFolderList[0] 
-   ;RT: Was gibt es im aktuellen ordner 
-   Local $sFileList = _FileListToArray($sPath & "\" & $sFolderList[$i]  , "*" & $extention , 1 ) 
-   ;RT: Umbennenenen der *.[$extention] 
-   if $sFileList <> 0 Then 
-   if $sFileList[0] = 1 Then 
- ;_ArrayDisplay($sFileList, "$sFileList") 
- $sFrom = $sPath & "\" & $sFolderList[$i] & "\" & $sFileList[$sFileList[0]] 
- $sTo = $sPathTo & "\" & $sFolderList[$i] &  $extention 
- FileCopy ( $sFrom, $sTo, 9 ) 
- ;DirRemove ( $sFrom ,1 ) 
- ;MsgBox ( 1, "OK", $sFrom & " => " & $sTo & "  " & @error ) 
-   Else 
- MsgBox ( 1, "ERROR", "Mehr als ein Subfolder in: " & $sPath & "\" & $sFolderList[$i]  ) 
- _ArrayDisplay($sFileList, "$sFileList") 
-   EndIf 
-   Else 
-   ;MsgBox ( 1, "No Subfolders in: ", $sPath & "\" & $sFolderList[$i]  ) 
-   endif 
-Next 
- 
-Exit 
- 
- 
- 
-</code> 
- 
-==== setup.ins ==== 
-<code winst> 
-[Actions] 
-requiredWinstVersion >= "4.10.5" 
-setLogLevel = 5 
-StayOnTop = on 
-DefVar $ProductId$ 
-DefVar $ProductNameShort$ 
-DefVar $ProductNameLong$ 
-DefVar $LocalDir$ 
-DefVar $ExitCode$ 
-DefVar $Part$ 
-DefVar $ValidOS$ 
-Set $ValidOS$ = "false" 
- 
-;----------------------------------------------------- 
-; Angaben zum Produkt 
-;----------------------------------------------------- 
-; Kurzer Produktname (max. 12 Zeichen) 
-Set $ProductNameShort$ = "Notepad++" 
-; Langer Produktname (max. 30 Zeichen) 
-Set $ProductNameLong$ = "Notepad++" 
-;----------------------------------------------------- 
-; Gewünschtes Betriebssystem (alle ungültigen auskommentieren) 
-; subCheckForWinXP-32 ; Windows XP 32-bit 
-; subCheckForVista-32 ; Windows Vista 32-bit  
-; subCheckForVista-64 ; Windows Vista 64-bit 
-; subCheckForSeven-32 ; Windows 7 32-bit 
- subCheckForSeven-64 ; Windows 7 64-bit 
-;----------------------------------------------------- 
- 
- 
- 
- 
-;----------------------------------------------------- 
-; Muss normalerweise nicht geändert werden 
-;----------------------------------------------------- 
- 
-; Bildchen und Statusmeldung 
-ShowBitmap "%ScriptPath%\image.png" $ProductNameShort$ 
-Message "Installiere " + $ProductNameLong$ + "..." 
- 
-; Lokalen Pfad erzeugen 
-Set $ProductId$  = "%installingProduct%" 
-if $ProductId$ = "" 
- Set $ProductId$  = "local_testing" 
-endif 
-Set $LocalDir$ = "%SystemDrive%\files\" + $ProductId$ 
- 
-; Prüfen, ob gültiges Betriebssystem 
-if $ValidOS$ = "false" 
- LogError "Dieses Betriebssystem (" + GetNtVersion + " " + GetSystemType + ") wird von diesem Produkt (" + $ProductId$ + ") nicht unterstützt!" 
- isFatalError 
-endif 
- 
-;----------------------------------------------------- 
-; Daten vorbereiten 
-;----------------------------------------------------- 
- FilesCleanDir 
- DosBatchMakeDir 
- 
-;----------------------------------------------------- 
-; Netzlaufwerk verbinden/Copy 
-;----------------------------------------------------- 
-DosInAnIcon_Q 
-DosInAnIcon_Copy 
- 
-;----------------------------------------------------- 
-; Die DeInstallation 
-;----------------------------------------------------- 
- Set $Part$ = "setup.exe" 
- if FileExists("%ProgramFiles32Dir%\VideoLAN\vlc\uninstall.exe") 
- Winbatch_uninstall 
- subCheckExitCodeVLC 
- Files_uninstall 
- endif 
- 
-;----------------------------------------------------- 
-; Die Installation 
-;----------------------------------------------------- 
- WinbatchInstallation 
- subCheckExitCodeEXE 
- DosBatch_Setings 
- FilesCleanTemp 
- ExitWindows /Reboot 
-;----------------------------------------------------- 
- 
-;----------------------------------------------------- 
-; Subroutinen 
-;----------------------------------------------------- 
-[FilesCleanDir] 
-Delete -s $LocalDir$ 
- 
-[DosBatchMakeDir] 
-@echo off 
-mkdir $LocalDir$ 
- 
-[WinbatchInstallation] 
-"C:\Temp\$ProductNameShort$\Notepad++.exe" /S 
- 
-;RT 2015.03.13:  
-; Da npp derzeit nicht dazu in der lage sit ein Globales userDefineLang.xml allen usern zur verfügung zu stellen 
-; z.B.: das Syntax Highlighting für winst dint das als workaround 
-; dabei kommt ein auto it skript zum einsatz das sich als Notepad++.exe ausgibt zum einsatz 
-; dise fängt den Befehl ab, Kopirt wenn noch nicht vorhanden die userDefineLang.xml nach %appdata%\Notepad++ 
-; und startet dan die umbenante Notepad+++.exe mit den ursprünglichen komandos. 
-[DosBatch_Setings] 
-ren "%ProgramFiles(x86)%\Notepad++\Notepad++.exe" "Notepad+++.exe" 
-COPY "%scriptpath%\userDefineLang\*.*" "%ProgramFiles(x86)%\Notepad++\" 
- 
- 
- 
-[Winbatch_uninstall] 
-"%ProgramFiles32Dir%\Notepad++\uninstall.exe" /S 
- 
-[Files_uninstall] 
-delete -sf "%ProgramFiles32Dir%\Notepad++\" 
- 
-;----------------------------------------------------- 
-; Netzlaufwerk verbinden/Copy 
-;----------------------------------------------------- 
-[DosInAnIcon_Q] 
-"p:\!drivemap\map_Q.exe" 
-[DosInAnIcon_Copy] 
-"Q:\$ProductNameShort$\Copy.exe" 
-[FilesCleanTemp] 
-Delete -s "%SystemDrive%\Temp\$ProductNameShort$" 
- 
- 
-;----------------------------------------------------- 
-; Subroutinen zur Überprüfung der ExitCodes 
-; Je nach Installer verschieden 
-;----------------------------------------------------- 
-; 
-; Windows Installer: subCheckExitCodeMSI 
-; 0 = Erfolgreich 
-; 3010 = Bitte Neustart 
- 
-; Diverse EXE-Dateien: subCheckExitCodeEXE 
-; 0 = Erfolgreich 
- 
-;----------------------------------------------------- 
- 
-[subCheckExitCodeMSI] 
-Set $ExitCode$ = getLastExitCode 
-; Abbruch bei Fehler 
-if not (($ExitCode$ = "0") or ($ExitCode$ = "3010")) 
- LogError "Fehler bei der Installation von " + $ProductNameLong$ + " (" + $Part$ + "): ExitCode " + $ExitCode$  
- isFatalError 
-endif 
-comment "Erfolgreiche Installation von " + $ProductNameLong$ + " (" + $Part$ + "): ExitCode " + $ExitCode$ 
-; Neustart, falls gewünscht 
-if $ExitCode$ = "3010" 
- set $Reboot$ = "true" 
-endif 
- 
-[subCheckExitCodeEXE] 
-Set $ExitCode$ = getLastExitCode 
-; Abbruch bei Fehler 
-if not ($ExitCode$ = "0") 
- LogError "Fehler bei der Installation von " + $ProductNameLong$ + " (" + $Part$ + "): ExitCode " + $ExitCode$  
- isFatalError 
-endif 
-comment "Erfolgreiche Installation von " + $ProductNameLong$ + " (" + $Part$ + "): ExitCode " + $ExitCode$ 
- 
- 
-[subReboot] 
-if $Reboot$ = "true" 
- ExitWindows /Reboot 
-endif 
- 
- 
- 
-;----------------------------------------------------- 
-; Subroutinen zur Überprüfung der Windows-Version 
-;----------------------------------------------------- 
-[subCheckForWinXP-32] 
-if GetMsVersionInfo = "5.1" AND GetSystemType = "x86 System" 
- Set $ValidOS$ = "true" 
-endif 
- 
-[subCheckForVista-32] 
-if GetMsVersionInfo = "6.0" AND GetSystemType = "x86 System" 
- Set $ValidOS$ = "true" 
-endif 
- 
-[subCheckForVista-64] 
-if GetMsVersionInfo = "6.0" AND GetSystemType = "64 bit System" 
- Set $ValidOS$ = "true" 
-endif 
- 
-[subCheckForSeven-32] 
-if GetMsVersionInfo = "6.1" AND GetSystemType = "x86 System" 
- Set $ValidOS$ = "true" 
-endif 
- 
-[subCheckForSeven-64] 
-if GetMsVersionInfo = "6.1" AND GetSystemType = "64 bit System" 
- Set $ValidOS$ = "true" 
-endif 
-</code> 
- 
-==== uninstall.ins ==== 
-<code winst> 
-; (c) Robert Tauber 2014 
- 
-[Actions] 
-requiredWinstVersion >= "4.10.5" 
-setLogLevel = 5 
-StayOnTop = on 
-DefVar $ProductId$ 
-DefVar $ProductNameShort$ 
-DefVar $ProductNameLong$ 
-DefVar $LocalDir$ 
-DefVar $ExitCode$ 
-DefVar $Part$ 
-DefVar $ValidOS$ 
-Set $ValidOS$ = "false" 
- 
-;----------------------------------------------------- 
-; Angaben zum Produkt 
-;----------------------------------------------------- 
-; Kurzer Produktname (max. 12 Zeichen) 
-Set $ProductNameShort$ = "Adobe Reader" 
-; Langer Produktname (max. 30 Zeichen) 
-Set $ProductNameLong$ = "Adobe Reader" 
-;----------------------------------------------------- 
-; Gewünschtes Betriebssystem (alle ungültigen auskommentieren) 
-; subCheckForWinXP-32 ; Windows XP 32-bit 
-; subCheckForVista-32 ; Windows Vista 32-bit  
-; subCheckForVista-64 ; Windows Vista 64-bit 
-; subCheckForSeven-32 ; Windows 7 32-bit 
- subCheckForSeven-64 ; Windows 7 64-bit 
-;----------------------------------------------------- 
- 
- 
- 
- 
-;----------------------------------------------------- 
-; Muss normalerweise nicht geändert werden 
-;----------------------------------------------------- 
- 
-; Bildchen und Statusmeldung 
-ShowBitmap "%ScriptPath%\image.png" $ProductNameShort$ 
-Message "Deinstalliere " + $ProductNameLong$ + "..." 
- 
-; Lokalen Pfad erzeugen 
-Set $ProductId$  = "%installingProduct%" 
-if $ProductId$ = "" 
- Set $ProductId$  = "local_testing" 
-endif 
-Set $LocalDir$ = "%SystemDrive%\files\" + $ProductId$ 
- 
-; Prüfen, ob gültiges Betriebssystem 
-if $ValidOS$ = "false" 
- LogError "Dieses Betriebssystem (" + GetNtVersion + " " + GetSystemType + ") wird von diesem Produkt (" + $ProductId$ + ") nicht unterstützt!" 
- isFatalError 
-endif 
- 
-;----------------------------------------------------- 
-; Daten vorbereiten 
-;----------------------------------------------------- 
- FilesCleanDir 
- DosBatchMakeDir 
- 
-;----------------------------------------------------- 
-; Netzlaufwerk verbinden/Copy 
-;----------------------------------------------------- 
-;DosInAnIcon_Q 
-;DosInAnIcon_Copy 
- 
- 
- 
- 
-;----------------------------------------------------- 
-; Die DeInstallation 
-;----------------------------------------------------- 
- Set $Part$ = "setup.exe" 
- if FileExists("%ProgramFiles32Dir%\VideoLAN\vlc\uninstall.exe") 
- Winbatch_uninstall 
- subCheckExitCodeVLC 
- Files_uninstall 
- endif 
- Winbatch_uninstall 
- subCheckExitCodeEXE 
- FilesCleanTemp 
- Files_uninstall 
- ExitWindows /Reboot 
-;----------------------------------------------------- 
- 
-;----------------------------------------------------- 
-; Subroutinen 
-;----------------------------------------------------- 
-[FilesCleanDir] 
-Delete -s $LocalDir$ 
- 
-[DosBatchMakeDir] 
-@echo off 
-mkdir $LocalDir$ 
- 
-[Winbatch_uninstall] 
-"%ProgramFiles32Dir%\Notepad++\uninstall.exe" /S 
- 
-[Files_uninstall] 
-delete -sf "%ProgramFiles32Dir%\Notepad++\" 
- 
- 
-;----------------------------------------------------- 
-; Netzlaufwerk verbinden/Copy 
-;----------------------------------------------------- 
-[DosInAnIcon_Q] 
-"p:\!drivemap\map_Q.exe" 
-[DosInAnIcon_Copy] 
-"Q:\$ProductNameShort$\Copy.exe" 
-[FilesCleanTemp] 
-Delete -s "%SystemDrive%\Temp\$ProductNameShort$" 
- 
- 
-;----------------------------------------------------- 
-; Subroutinen zur Überprüfung der ExitCodes 
-; Je nach Installer verschieden 
-;----------------------------------------------------- 
-; 
-; Windows Installer: subCheckExitCodeMSI 
-; 0 = Erfolgreich 
-; 3010 = Bitte Neustart 
- 
-; Diverse EXE-Dateien: subCheckExitCodeEXE 
-; 0 = Erfolgreich 
- 
-;----------------------------------------------------- 
- 
-[subCheckExitCodeMSI] 
-Set $ExitCode$ = getLastExitCode 
-; Abbruch bei Fehler 
-if not (($ExitCode$ = "0") or ($ExitCode$ = "3010")) 
- LogError "Fehler bei der Installation von " + $ProductNameLong$ + " (" + $Part$ + "): ExitCode " + $ExitCode$  
- isFatalError 
-endif 
-comment "Erfolgreiche Installation von " + $ProductNameLong$ + " (" + $Part$ + "): ExitCode " + $ExitCode$ 
-; Neustart, falls gewünscht 
-if $ExitCode$ = "3010" 
- set $Reboot$ = "true" 
-endif 
- 
-[subCheckExitCodeEXE] 
-Set $ExitCode$ = getLastExitCode 
-; Abbruch bei Fehler 
-if not ($ExitCode$ = "0") 
- LogError "Fehler bei der Installation von " + $ProductNameLong$ + " (" + $Part$ + "): ExitCode " + $ExitCode$  
- isFatalError 
-endif 
-comment "Erfolgreiche Installation von " + $ProductNameLong$ + " (" + $Part$ + "): ExitCode " + $ExitCode$ 
- 
-[subReboot] 
-if $Reboot$ = "true" 
- ExitWindows /Reboot 
-endif 
- 
- 
- 
-;----------------------------------------------------- 
-; Subroutinen zur Überprüfung der Windows-Version 
-;----------------------------------------------------- 
-[subCheckForWinXP-32] 
-if GetMsVersionInfo = "5.1" AND GetSystemType = "x86 System" 
- Set $ValidOS$ = "true" 
-endif 
- 
-[subCheckForVista-32] 
-if GetMsVersionInfo = "6.0" AND GetSystemType = "x86 System" 
- Set $ValidOS$ = "true" 
-endif 
- 
-[subCheckForVista-64] 
-if GetMsVersionInfo = "6.0" AND GetSystemType = "64 bit System" 
- Set $ValidOS$ = "true" 
-endif 
- 
-[subCheckForSeven-32] 
-if GetMsVersionInfo = "6.1" AND GetSystemType = "x86 System" 
- Set $ValidOS$ = "true" 
-endif 
- 
-[subCheckForSeven-64] 
-if GetMsVersionInfo = "6.1" AND GetSystemType = "64 bit System" 
- Set $ValidOS$ = "true" 
-endif 
- 
-</code> 
- 
-==== notepad++.exe / notepad++.au3 ==== 
-<code autoit> 
-#include <Array.au3> 
- 
-;=== Befehle aufbereiten === 
-;RT 2015.03.13:  
-;  Ziel ist es die aufruf parameter korekt weiter zu geben 
-$pfad = @ScriptDir 
-$name = "notepad+++.exe" 
-$cmp = _ArrayToString($CmdLine, " ",1) 
-$prog = '"' & $pfad & "\" & $name & '" ' & $cmp 
-;RT 2015.03.13: Zur kontrolle 
-;MsgBox(1,"",$prog) 
- 
- 
-;=== Zusatz Aktionen === 
-;RT 2015.03.13: 
-;  Was Soll Pasiren befor das Programm aufgerufen wird 
-; == Kopiren == 
-;RT 2015.03.13: Quelle und Ziel definiren 
-$file = "userDefineLang.xml" 
-$quelle = @ScriptDir & "\" & $file 
-$ziel = @AppDataDir & "\Notepad++\" & $file 
- 
-;RT 2015.03.13: Prüfen ob Quelle ok und Ziel nochnicht vorhanden 
-if FileExists($quelle) and not FileExists($ziel) then 
-   ;RT 2015.03.13: Zur kontrolle 
-   ;MsgBox(1,"",$quelle & " ==> " & $ziel) 
-   FileCopy ($quelle,$ziel,8) & @error) 
-EndIf 
- 
-run ($prog) 
-;RT 2015.03.13: Zur kontrolle 
-;MsgBox(1,"",$prog) 
- 
-</code> 
  
userspace/etu_notepad.txt · Last modified: 2021/08/23 08:37 (external edit)