This shows you the differences between two versions of the page.
userspace:a_master_copy_for_inserting_scripts_-_eine_vorlage_um_einstellen_von_scripten [2013/08/05 15:43] MrNiceguy [uninstall.ins] |
userspace:a_master_copy_for_inserting_scripts_-_eine_vorlage_um_einstellen_von_scripten [2021/08/23 08:37] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | \\ | ||
- | **This is a master copy. Click on <edit this page> and copy the contents under " | ||
- | |||
- | ====== UltraVNC Viewer ====== | ||
- | |||
- | |||
- | Tested with opsi 4.0.1\\ | ||
- | requiredWinstVersion >= 4.11.3.6\\ | ||
- | By // | ||
- | |||
- | Files can be downloaded at http:// | ||
- | |||
- | Tree:\\ | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | |||
- | |||
- | === setup.ins === | ||
- | <code winst> | ||
- | ; Copyright (c) uib gmbh (www.uib.de) | ||
- | ; This sourcecode is owned by uib | ||
- | ; and published under the Terms of the General Public License. | ||
- | ; credits: http:// | ||
- | |||
- | [Actions] | ||
- | requiredWinstVersion >= " | ||
- | |||
- | DefVar $MsiId$ | ||
- | DefVar $UninstallProgram$ | ||
- | DefVar $LogDir$ | ||
- | DefVar $ProductId$ | ||
- | DefVar $MinimumSpace$ | ||
- | DefVar $InstallDir$ | ||
- | DefVar $ExitCode$ | ||
- | DefVar $LicenseRequired$ | ||
- | DefVar $LicenseKey$ | ||
- | DefVar $LicensePool$ | ||
- | |||
- | Set $LogDir$ = " | ||
- | |||
- | ; ---------------------------------------------------------------- | ||
- | ; - Please edit the following values | ||
- | ; ---------------------------------------------------------------- | ||
- | ; | ||
- | ; therefore please: only lower letters, no umlauts, | ||
- | ; no white space use ' | ||
- | Set $ProductId$ | ||
- | Set $MinimumSpace$ | ||
- | ; the path were we find the product after the installation | ||
- | Set $InstallDir$ | ||
- | Set $LicenseRequired$ = " | ||
- | Set $LicensePool$ | ||
- | ; ---------------------------------------------------------------- | ||
- | |||
- | if not(HasMinimumSpace (" | ||
- | LogError "Not enough space on %SystemDrive%, | ||
- | isFatalError | ||
- | ; Stop process and set installation status to failed | ||
- | else | ||
- | comment "Show product picture" | ||
- | ShowBitmap " | ||
- | |||
- | if FileExists($InstallDir$ + " | ||
- | comment "Start uninstall sub section" | ||
- | Sub " | ||
- | Sub " | ||
- | endif | ||
- | |||
- | Message " | ||
- | |||
- | if $LicenseRequired$ = " | ||
- | comment " | ||
- | Sub_get_licensekey | ||
- | endif | ||
- | |||
- | comment "Start setup program" | ||
- | Winbatch_install | ||
- | Sub_check_exitcode | ||
- | |||
- | comment "Copy files" | ||
- | Files_install /32Bit | ||
- | |||
- | comment "Start application" | ||
- | Sub " | ||
- | endif | ||
- | |||
- | [Winbatch_install] | ||
- | " | ||
- | |||
- | [Files_install] | ||
- | copy -s " | ||
- | |||
- | [Sub_get_licensekey] | ||
- | if opsiLicenseManagementEnabled | ||
- | comment " | ||
- | |||
- | comment " | ||
- | 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 " | ||
- | 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: " + $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> | ||
- | ; 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 "Sart task kill sub section" | ||
- | Sub " | ||
- | endif | ||
- | |||
- | if FileExists(" | ||
- | comment "Start uninstall sub section" | ||
- | Sub " | ||
- | endif | ||
- | |||
- | if $LicenseRequired$ = " | ||
- | comment " | ||
- | Sub_free_license | ||
- | endif | ||
- | |||
- | ; | ||
- | ;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("", | ||
- | </ | ||
- | |||
- | ===delsub.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:// | ||
- | |||
- | |||
- | Set $MsiId$ = ' | ||
- | Set $UninstallProgram$ = $InstallDir$ + " | ||
- | |||
- | Message " | ||
- | |||
- | if FileExists($UninstallProgram$) | ||
- | ; comment " | ||
- | Winbatch_uninstall | ||
- | ; | ||
- | sub_check_exitcode | ||
- | endif | ||
- | ;if not (GetRegistryStringValue32(" | ||
- | ; comment "MSI id " + $MsiId$ + " found in registry, starting msiexec to uninstall" | ||
- | ; | ||
- | ; | ||
- | ;endif | ||
- | |||
- | ;comment " | ||
- | ; | ||
- | |||
- | ;comment " | ||
- | winbatch_uninstall | ||
- | |||
- | comment " | ||
- | Files_uninstall /32Bit | ||
- | |||
- | comment " | ||
- | Registry_uninstall /32Bit | ||
- | |||
- | comment " | ||
- | LinkFolder_uninstall | ||
- | |||
- | [Winbatch_uninstall] | ||
- | ; Choose one of the following examples as basis for program uninstall | ||
- | ; | ||
- | ; === Nullsoft Scriptable Install System ================================================================ | ||
- | ; " | ||
- | ;net stop uvnc_service | ||
- | ;sc delete uvnc_service | ||
- | ;Sub " | ||
- | " | ||
- | ; | ||
- | ; === Inno Setup ======================================================================================== | ||
- | |||
- | ; | ||
- | ; net stop uvnc_service | ||
- | ; sc delete uvnc_service | ||
- | ; " | ||
- | |||
- | ; | ||
- | ;msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress | ||
- | |||
- | [Files_uninstall] | ||
- | ; Example for recursively deleting the installation directory (don't forget the trailing backslash): | ||
- | ; | ||
- | | ||
- | |||
- | [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 " | ||
- | 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 | ||
- | |||
- | </ | ||
- | |||
- | ===killtask.ins=== | ||
- | <code winst> | ||
- | [Actions] | ||
- | setloglevel = 6 | ||
- | requiredWinstVersion >= " | ||
- | |||
- | DefVar $process2$ | ||
- | DefVar $subvar$ | ||
- | DefVar $killtask$ | ||
- | |||
- | DefStringList $processlist$ | ||
- | DefStringList $process$ | ||
- | DefStringList $SearchProcess$ | ||
- | |||
- | ; | ||
- | set $searchProcess$ = createStringList (' | ||
- | ;sollen die Programme automatisch geschlossen werden? ACHTUNG: Datenverlust möglich! | ||
- | set $killtask$ = " | ||
- | ; | ||
- | |||
- | for %s% in $SearchProcess$ do sub_checkfunktion | ||
- | |||
- | [sub_checkfunktion] | ||
- | set $subvar$ = " | ||
- | set $processlist$ = getOutStreamFromSection(' | ||
- | set $process$ = splitString(takeString(1, | ||
- | set $process2$ = unquote(takeString(1, | ||
- | |||
- | DosBatch_1 | ||
- | |||
- | if ($process2$ = $subvar$) | ||
- | Message = " | ||
- | if ($killtask$ = " | ||
- | killtask $subvar$ | ||
- | else | ||
- | message " | ||
- | endif | ||
- | else | ||
- | message = " | ||
- | endif | ||
- | |||
- | |||
- | |||
- | [DosInAnIcon_checkprocess] | ||
- | @echo off | ||
- | TASKLIST /FI " | ||
- | |||
- | [DosBatch_1] | ||
- | net stop uvnc_service | ||
- | sc delete uvnc_service | ||
- | </ | ||
- | ==== Steps ==== | ||
- | - here you enter special steps, if needed. Explain it well, so an opsi-beginner can do it. | ||
- | - step two | ||
- | - step three | ||
- | - ... | ||
- | |||
- | [[nix|Change the following headlines to the names of your scripts]] | ||
- | |||
- | |||
- | |||
- | ==== delsub.ins ==== | ||
- | <code winst> | ||
- | click on "edit this page" to see the complete source. | ||
- | </ | ||
- | |||
- | ==== myvbs.vbs ==== | ||
- | <code vb> | ||
- | ;this is my vbs-script... | ||
- | echo click on "edit this page" to see the complete source. | ||
- | </ | ||
- | |||