This shows you the differences between two versions of the page.
userspace:baywotch [2011/10/27 14:37] Thomas_H |
userspace:baywotch [2021/08/23 08:37] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Baywotch ====== | ||
- | Tested with opsi 4.0.1\\ | ||
- | requiredWinstVersion >= 4.8.6\\ | ||
- | questions to: // | ||
- | The installation-files can be downloaded from: http:// | ||
- | |||
- | Please note: This script is a lil bit older, made unter Opsi 3.5 It also functions with the new Opsi 4.0 but is not as well structured like it should. | ||
- | |||
- | Tree:\\ | ||
- | baywotch.bmp\\ | ||
- | bw4setup.exe\\ | ||
- | delsub.ins\\ | ||
- | setup.ins\\ | ||
- | uninstall.ins | ||
- | |||
- | ==== setup.ins ==== | ||
- | |||
- | <code winst> | ||
- | [Initial] | ||
- | requiredWinstVersion >= " | ||
- | LogLevel=2 | ||
- | ; Log Errors in Logfile but don't abort: | ||
- | ExitOnError=false | ||
- | ; Show syntax errors in the script: | ||
- | ScriptErrorMessages=on | ||
- | ; Dont trace step by step through the script: | ||
- | TraceMode=off | ||
- | ; let started programs run in front of the winst window | ||
- | StayOnTop=false | ||
- | |||
- | [Aktionen] | ||
- | DefVar $TEMP$ | ||
- | DefVar $ProductId$ | ||
- | DefVar $MinimumSpace$ | ||
- | DefVar $NewExe$ | ||
- | DefVar $InstallDir$ | ||
- | DefVar $ExitCode$ | ||
- | DefVar $LicenseRequired$ | ||
- | DefVar $LicenseKey$ | ||
- | DefVar $LicensePool$ | ||
- | |||
- | comment "show product picture" | ||
- | ShowBitmap /3 | ||
- | if FileExists (" | ||
- | ShowBitmap /3 " | ||
- | endif | ||
- | |||
- | |||
- | ; This should be edited | ||
- | set $ProductId$ = " | ||
- | set $MinimumSpace$ = "100 MB" | ||
- | set $InstallDir$=" | ||
- | set $NewExe$=$InstallDir$+" | ||
- | set $LicenseRequired$ = " | ||
- | set $LicensePool$ = " | ||
- | |||
- | |||
- | Set $TEMP$ = EnvVar(" | ||
- | |||
- | ; Message at install time: | ||
- | Message " | ||
- | |||
- | ; Message at install time: | ||
- | Message " | ||
- | |||
- | if not(HasMinimumSpace (" | ||
- | LogError "Not enough space on %SYSTEMDRIVE%: | ||
- | isFatalError | ||
- | ; stop process and set installation status to failed | ||
- | else | ||
- | |||
- | if FileExists(" | ||
- | comment | ||
- | sub " | ||
- | endif | ||
- | |||
- | ;Message at install time: | ||
- | Message " | ||
- | |||
- | comment "if license management enabled, reserve license and get license key" | ||
- | if ($LicenseRequired$ = " | ||
- | sub_get_licensekey | ||
- | endif | ||
- | |||
- | comment "start setup program" | ||
- | Winbatch_install | ||
- | sub_check_exitcode | ||
- | |||
- | comment "test for installation success" | ||
- | if not(FileExists($NewExe$)) | ||
- | logError " | ||
- | isFatalError | ||
- | endif | ||
- | |||
- | endif | ||
- | |||
- | [Winbatch_install] | ||
- | " | ||
- | ; $licensekey$ may be inserted into the additional parameters string | ||
- | |||
- | [sub_get_licensekey] | ||
- | if opsiLicenseManagementEnabled | ||
- | comment " | ||
- | |||
- | comment "try to to get license key" | ||
- | Set $licensekey$ = demandLicenseKey ($licensepool$) | ||
- | ; if there is an assignment of exactly one licensepool to the product the following call is possible: | ||
- | ; Set $licensekey$ = demandLicenseKey ("", | ||
- | ; if there is an assignment of a license pool to a windows software id, it is possible to use | ||
- | ; DefVar $windowsSoftwareId$ | ||
- | ; $windowsSoftwareId$ = " | ||
- | ; Set $licensekey$ = demandLicenseKey ("", | ||
- | |||
- | DefVar $serviceErrorClass$ | ||
- | set $serviceErrorClass$ = getLastServiceErrorClass | ||
- | comment "error class: " + $serviceErrorClass$ | ||
- | |||
- | if $serviceErrorClass$ = " | ||
- | comment " | ||
- | comment "we got the license key '" | ||
- | else | ||
- | if $serviceErrorClass$ = " | ||
- | LogError " | ||
- | LogError getLastServiceErrorMessage | ||
- | isFatalError | ||
- | else | ||
- | if $serviceErrorClass$ = " | ||
- | LogError " | ||
- | isFatalError | ||
- | endif | ||
- | endif | ||
- | endif | ||
- | else | ||
- | LogError " | ||
- | isFatalError | ||
- | 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: " | ||
- | 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> | ||
- | ; copyright (c) uib gmbh (www.uib.de) | ||
- | ; This sourcecode is owned by uib gmbh | ||
- | ; and published under the Terms of the General Public License. | ||
- | ; credits: http:// | ||
- | |||
- | [Actions] | ||
- | requiredWinstVersion >= " | ||
- | DefVar $MsiId$ | ||
- | ;DefVar $UninstallProgram$ | ||
- | DefVar $LogDir$ | ||
- | DefVar $ExitCode$ | ||
- | DefVar $ProductId$ | ||
- | DefVar $InstallDir$ | ||
- | DefVar $LicenseRequired$ | ||
- | DefVar $LicensePool$ | ||
- | Set $LogDir$ = " | ||
- | ; ---------------------------------------------------------------- | ||
- | ; - Please edit the following values | ||
- | ; ---------------------------------------------------------------- | ||
- | Set $ProductId$ | ||
- | Set $InstallDir$ | ||
- | Set $LicenseRequired$ = " | ||
- | Set $LicensePool$ | ||
- | ; ---------------------------------------------------------------- | ||
- | comment "Show product picture" | ||
- | ShowBitmap " | ||
- | Message " | ||
- | if FileExists(" | ||
- | comment "Start uninstall sub section" | ||
- | Sub " | ||
- | endif | ||
- | if $LicenseRequired$ = " | ||
- | comment " | ||
- | Sub_free_license | ||
- | endif | ||
- | |||
- | [Sub_free_license] | ||
- | if opsiLicenseManagementEnabled | ||
- | comment " | ||
- | comment " | ||
- | DefVar $result$ | ||
- | Set $result$ = FreeLicense($LicensePool$) | ||
- | ; If there is an assignment of a license pool to | ||
- | ; the product, it is possible to use | ||
- | ; Set $result$ = FreeLicense("", | ||
- | ; | ||
- | ; If there is an assignment of a license pool to | ||
- | ; a windows software id, it is possible to use | ||
- | ; DefVar $WindowsSoftwareId$ | ||
- | ; $WindowsSoftwareId$ = " | ||
- | ; set $result$ = FreeLicense("", | ||
- | else | ||
- | LogError " | ||
- | isFatalError | ||
- | endif | ||
- | |||
- | </ | ||
- | |||
- | ===== delsub.ins ===== | ||
- | |||
- | <code winst> | ||
- | DefVar $UninstallProgram$ | ||
- | Set $UninstallProgram$ = " | ||
- | ;Set $UninstallProgram$ = " | ||
- | |||
- | Message " | ||
- | if FileExists($UninstallProgram$) | ||
- | comment " | ||
- | Winbatch_uninstall | ||
- | sub_check_exitcode | ||
- | endif | ||
- | ; if not (GetRegistryStringValue([HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" | ||
- | ; comment "MSI id " + $MsiId$ + " found in registry, starting msiexec to uninstall" | ||
- | ; Winbatch_uninstall_msi | ||
- | ; sub_check_exitcode | ||
- | ; endif | ||
- | |||
- | comment " | ||
- | Files_uninstall | ||
- | comment " | ||
- | Registry_uninstall | ||
- | comment " | ||
- | LinkFolder_uninstall | ||
- | |||
- | [Winbatch_uninstall] | ||
- | ; Choose one of the following examples as basis for program uninstall | ||
- | ; | ||
- | ; === Nullsoft Scriptable Install System ================================== | ||
- | ; " | ||
- | ; | ||
- | ; === Inno Setup ========================================================== | ||
- | " | ||
- | |||
- | [Winbatch_uninstall_msi] | ||
- | ;msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress | ||
- | |||
- | [Files_uninstall] | ||
- | ; Example for recursively deleting the installation directory | ||
- | ; (don't forget the trailing backslash): | ||
- | ; | ||
- | ; delete -sf " | ||
- | |||
- | [Registry_uninstall] | ||
- | ; Example of deleting a registry key: | ||
- | ; | ||
- | ; deletekey [HKEY_LOCAL_MACHINE\Software\$ProductId$] | ||
- | |||
- | [LinkFolder_uninstall] | ||
- | ; Example of deleting a folder from AllUsers startmenu: | ||
- | ; | ||
- | ; set_basefolder common_programs | ||
- | ; delete_subfolder $ProductId$ | ||
- | ; | ||
- | ; Example of deleting a shortcut from AllUsers desktop: | ||
- | ; | ||
- | ; set_basefolder common_desktopdirectory | ||
- | ; set_subfolder "" | ||
- | ; delete_element $ProductId$ | ||
- | |||
- | [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 "that are currently installed." | ||
- | 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 " | ||
- | comment " | ||
- | else | ||
- | logError " | ||
- | logError $ExitCode$ | ||
- | isFatalError | ||
- | endif | ||
- | endif | ||
- | endif | ||
- | endif | ||
- | |||
- | </ |