This shows you the differences between two versions of the page.
userspace:7-zip [2012/10/05 09:35] Thomas_H |
userspace:7-zip [2021/08/23 08:37] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Product : 7-zip 920 ====== | ||
- | Script by Lars_k \\ | ||
- | Tested with opsi 4.0.1 \\ | ||
- | Test with W7 32 & 64 Bit \\ | ||
- | The installion-files available Download from : [[http:// | ||
- | |||
- | Tree: \\ | ||
- | < | ||
- | DATA_CLIENT\\ | ||
- | ├ Bild.png ( Product Picture) | ||
- | ├ setup.ins \\ | ||
- | ├ uninstall.ins \\ | ||
- | └ depot | ||
- | ├ 7z920.exe \\ | ||
- | └ 7z920-x64.msi \\ | ||
- | </ | ||
- | ===== setup.ins ===== | ||
- | <code winst> | ||
- | [Initial] | ||
- | ExitOnError=true | ||
- | StayOnTop = true | ||
- | |||
- | [Actions] | ||
- | requiredWinstVersion >= " | ||
- | |||
- | DefVar $ProductId$ | ||
- | DefVar $ExitCode$ | ||
- | DefVar $NTVersioninfo$ | ||
- | DefVar $32bitfile$ | ||
- | DefVar $64bitfile$ | ||
- | DefVar $uninstallstring$ | ||
- | DefVar $Parameter$ | ||
- | SetLogLevel=6 | ||
- | Set $32bitfile$ =" | ||
- | Set $64bitfile$ =" | ||
- | ; ---------------------------------------------------------------- | ||
- | Set $ProductId$ | ||
- | ; ---------------------------------------------------------------- | ||
- | |||
- | ShowBitmap | ||
- | Message " | ||
- | |||
- | if not (HasMinimumSpace (" | ||
- | LogError "Es ist nicht genügend freien Speicherplatz auf dem Laufwerk : %SYSTEMDRIVE% | ||
- | isFatalError | ||
- | endif | ||
- | |||
- | ; OS Version ermitteln | ||
- | Set $NTVersioninfo$ = GetMsVersionInfo | ||
- | |||
- | if not ( $NTVersioninfo$ >= " | ||
- | LogError "Kein Komp. Betriebssystem vorhanden." | ||
- | isFatalError | ||
- | endif | ||
- | |||
- | ; 64 Bit OS | ||
- | if GetSystemType = "64 Bit System" | ||
- | comment " 64 Bit System" | ||
- | Sub_uninstall | ||
- | Winbatch_7zip64bit | ||
- | comment " 7Zip wird installiert" | ||
- | Sub_check_exitcode | ||
- | endif | ||
- | |||
- | ; 32 Bit OS | ||
- | if GetSystemType = "x86 System" | ||
- | comment " 32 Bit System" | ||
- | Sub_uninstall | ||
- | Winbatch_7zip32bit | ||
- | comment " 7Zip wird installiert" | ||
- | Sub_check_exitcode | ||
- | endif | ||
- | |||
- | |||
- | [Winbatch_7zip32bit] | ||
- | %ScriptPath%\depot\$32bitfile$ /S | ||
- | |||
- | |||
- | [Winbatch_7zip64bit] | ||
- | msiexec /i %ScriptPath%\depot\$64bitfile$ /qn | ||
- | |||
- | |||
- | [Winbatch_remove] | ||
- | " | ||
- | |||
- | |||
- | [Sub_uninstall] | ||
- | ; Prüft ob eine 64 Bit Version installiert ist. | ||
- | if ( FileExists(" | ||
- | comment "64 Bit Version gefunden" | ||
- | Set $uninstallstring$ = " | ||
- | Set $Parameter$ = " / | ||
- | Winbatch_remove | ||
- | Sub_check_exitcode | ||
- | comment "64 Bit Version deinstalliert" | ||
- | endif | ||
- | |||
- | ; Prüft ob eine 32 Bit Version installiert ist. | ||
- | if ( FileExists(" | ||
- | comment "32 Bit Version gefunden" | ||
- | Set $uninstallstring$ = " | ||
- | Set $Parameter$ = " /S" | ||
- | Winbatch_remove | ||
- | Sub_check_exitcode | ||
- | comment "32 Bit Version deinstalliert" | ||
- | endif | ||
- | |||
- | |||
- | [Sub_check_exitcode] | ||
- | comment "Test for installation success via exit code" | ||
- | set $ExitCode$ = getLastExitCode | ||
- | ; informations to exit codes see | ||
- | ; http:// | ||
- | ; http:// | ||
- | if ($ExitCode$ = " | ||
- | comment "Looks good: setup program gives exitcode zero" | ||
- | else | ||
- | comment "Setup program gives a exitcode unequal zero: " + $ExitCode$ | ||
- | if ($ExitCode$ = " | ||
- | comment " | ||
- | comment " | ||
- | else | ||
- | if ($ExitCode$ = " | ||
- | comment "looks good: setup program gives exitcode 1641" | ||
- | comment " | ||
- | else | ||
- | if ($ExitCode$ = " | ||
- | comment "looks good: setup program gives exitcode 3010" | ||
- | comment " | ||
- | else | ||
- | logError " | ||
- | isFatalError | ||
- | endif | ||
- | endif | ||
- | endif | ||
- | endif | ||
- | </ | ||
- | |||
- | |||
- | ===== uninstall.ins ===== | ||
- | <code winst> | ||
- | [Initial] | ||
- | ExitOnError=true | ||
- | StayOnTop = true | ||
- | |||
- | |||
- | [Actions] | ||
- | requiredWinstVersion >= " | ||
- | |||
- | DefVar $ProductId$ | ||
- | DefVar $ExitCode$ | ||
- | DefVar $NTVersioninfo$ | ||
- | DefVar $uninstallstring$ | ||
- | DefVar $Parameter$ | ||
- | SetLogLevel=6 | ||
- | |||
- | ; ---------------------------------------------------------------- | ||
- | Set $ProductId$ | ||
- | ; ---------------------------------------------------------------- | ||
- | ShowBitmap | ||
- | Message " | ||
- | |||
- | ; OS Version ermitteln | ||
- | Set $NTVersioninfo$ = GetMsVersionInfo | ||
- | |||
- | if not ( $NTVersioninfo$ >= " | ||
- | LogError "Kein Komp. Betriebssystem vorhanden." | ||
- | isFatalError | ||
- | endif | ||
- | |||
- | ; 64 Bit OS | ||
- | if GetSystemType = "64 Bit System" | ||
- | comment " 64 Bit System" | ||
- | comment " 7Zip wird entfernt." | ||
- | Sub_uninstall | ||
- | endif | ||
- | |||
- | ; 32 Bit OS | ||
- | if GetSystemType = "x86 System" | ||
- | comment " 32 Bit System" | ||
- | comment " 7Zip wird entfernt" | ||
- | Sub_uninstall | ||
- | endif | ||
- | |||
- | |||
- | [Winbatch_remove] | ||
- | " | ||
- | |||
- | |||
- | [Sub_uninstall] | ||
- | ; Prüft ob eine 64 Bit Version installiert ist. | ||
- | if ( FileExists(" | ||
- | comment "64 Bit Version gefunden" | ||
- | Set $uninstallstring$ = " | ||
- | Set $Parameter$ = " / | ||
- | Winbatch_remove | ||
- | Sub_check_exitcode | ||
- | comment "64 Bit Version deinstalliert" | ||
- | endif | ||
- | |||
- | ; Prüft ob eine 32 Bit Version installiert ist. | ||
- | if ( FileExists(" | ||
- | comment "32 Bit Version gefunden" | ||
- | Set $uninstallstring$ = " | ||
- | Set $Parameter$ = " /S" | ||
- | Winbatch_remove | ||
- | Sub_check_exitcode | ||
- | comment "32 Bit Version deinstalliert" | ||
- | endif | ||
- | |||
- | |||
- | [Sub_check_exitcode] | ||
- | comment "Test for installation success via exit code" | ||
- | set $ExitCode$ = getLastExitCode | ||
- | ; informations to exit codes see | ||
- | ; http:// | ||
- | ; http:// | ||
- | if ($ExitCode$ = " | ||
- | comment "Looks good: setup program gives exitcode zero" | ||
- | else | ||
- | comment "Setup program gives a exitcode unequal zero: " + $ExitCode$ | ||
- | if ($ExitCode$ = " | ||
- | comment " | ||
- | comment " | ||
- | else | ||
- | if ($ExitCode$ = " | ||
- | comment "looks good: setup program gives exitcode 1641" | ||
- | comment " | ||
- | else | ||
- | if ($ExitCode$ = " | ||
- | comment "looks good: setup program gives exitcode 3010" | ||
- | comment " | ||
- | else | ||
- | logError " | ||
- | isFatalError | ||
- | endif | ||
- | endif | ||
- | endif | ||
- | endif | ||
- | </ |