====== ETU Seafile ====== **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:\Seafile\Seafile\seafile-#.#.#-en.msi 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]] (Für *.msi)\\ Seafile\seafile-#.#.#-en.msi\\ Tree (..\notepadpp):\\ OPSI\control\\ CLIENT_DATA\setup.ins\\ CLIENT_DATA\uninstall.ins\\ CLIENT_DATA\image.png\\ ==== control ==== [Package] version: 2014.12.08 depends: incremental: False [Product] type: localboot id: seafile name: Seafile description: Seafile Client advice: packed by Johannes Blattner version: 0 priority: 0 licenseRequired: False productClasses: setupScript: setup.ins uninstallScript: uninstall.ins updateScript: alwaysScript: onceScript: customScript: userLoginScript: [ProductDependency] action: setup requiredProduct: cleanup requiredAction: setup requirementType: after [ProductDependency] action: uninstall requiredProduct: cleanup requiredAction: setup requirementType: after ==== setup.ins ==== ; 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$ DefVar $Reboot$ Set $ValidOS$ = "false" Set $Reboot$ = "false" ;----------------------------------------------------- ; Angaben zum Produkt ;----------------------------------------------------- ; Kurzer Produktname (max. 12 Zeichen) Set $ProductNameShort$ = "Seafile" ; Langer Produktname (max. 30 Zeichen) Set $ProductNameLong$ = "Seafile Client für seafile.studiendruck.de" ;----------------------------------------------------- ; 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 Installation ;----------------------------------------------------- WinbatchInstallation subCheckExitCodeEXE ; FilesCleanTemp ExitWindows /Reboot ;----------------------------------------------------- ; Subroutinen ;----------------------------------------------------- [FilesCleanDir] Delete -s $LocalDir$ [DosBatchMakeDir] @echo off mkdir $LocalDir$ [WinbatchInstallation] msiexec /i "C:\Temp\$ProductNameShort$\seafile.msi" /passive /log $LocalDir$\log.txt ;msiexec /i "%scriptpath%\files\seafile-3.1.7-en.msi" /passive /log $LocalDir$\log.txt ;----------------------------------------------------- ;----------------------------------------------------- ; 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 ==== uninstall.ins ==== ; Robert Tauber 2013 [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$ = "Elster-USB" ; Langer Produktname (max. 30 Zeichen) Set $ProductNameLong$ = "G&D StarSign USB Token für ELSTER" ;----------------------------------------------------- ; 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 ;----------------------------------------------------- ;----------------------------------------------------- ; Die Installation ;----------------------------------------------------- Set $Part$ = "setup.exe" WinbatchUnInstallation subCheckExitCodeEXE ExitWindows /Reboot ;----------------------------------------------------- ;----------------------------------------------------- ; Subroutinen ;----------------------------------------------------- [FilesCleanDir] Delete -s $LocalDir$ [DosBatchMakeDir] @echo off mkdir $LocalDir$ [WinbatchUnInstallation] "%scriptpath%\files\GuD_StarSign_USB_Token_fuer_ELSTER_64-1.2.0.exe" /S /f1"%scriptpath%\files\uninstall.iss" /f2"$LocalDir$\loguninstall.txt" ;----------------------------------------------------- ;----------------------------------------------------- ; 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