This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
userspace:a_master_copy_for_inserting_scripts_-_eine_vorlage_um_einstellen_von_scripten [2013/08/05 15:41] MrNiceguy [Programname Ver. 1.0] |
userspace:a_master_copy_for_inserting_scripts_-_eine_vorlage_um_einstellen_von_scripten [2021/08/23 08:37] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
\\ | \\ | ||
- | **This is a master copy. Click on <edit this page> and copy the contents under " | + | ====== getProductMap.opsiinc ====== |
- | ====== UltraVNC Viewer ====== | ||
+ | Tested with opsi 4.0.4\\ | ||
+ | requiredWinstVersion >= 4.11.2.\\ | ||
+ | By // | ||
- | Tested with opsi 4.0.1\\ | + | placed in global library, such as %ScriptDrive$/lib ... |
- | requiredWinstVersion >= 4.11.3.6\\ | + | call with |
- | By // | + | |
- | + | ||
- | Files can be downloaded at http:// | + | |
- | + | ||
- | Tree:\\ | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | + | ||
- | === setup.ins === | + | |
<code winst> | <code winst> | ||
- | ; Copyright (c) uib gmbh (www.uib.de) | + | include_insert |
- | ; 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$ = "%SystemDrive%\tmp" | + | |
- | + | ||
- | ; ---------------------------------------------------------------- | + | |
- | ; - 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 | + | |
- | + | ||
- | 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> | <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. |
- | ; and published under the Terms of the General Public License. | + | ; credits: http:// |
- | ; credits: http:// | + | ; |
- | + | ; written by GEI (Detlef Krummel | |
- | [Actions] | + | ; FILE "%ScriptDrive%\lib\getproductmap.opsiinc" |
- | 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("%ScriptPath%\killtask.ins" | + | requiredWinstVersion >="4.11.2" |
- | comment "Sart task kill sub section" | + | ; for debugging |
- | Sub " | + | |
- | endif | + | Set |
- | + | | |
- | if FileExists(" | + | ; --------------------------------- sample values --------------------------------------------------- |
- | comment "Start uninstall sub section" | + | ; 0)id=owncloud |
- | Sub " | + | ; 3)advice=(aktualisiert am 4.9.2014) 4)productversion=1.6.3.3721 5)packageversion=17 |
- | endif | + | ; 6)priority=0 7)installationstate=unknown |
- | + | ; 9)lastactionresult=successful | |
- | if $LicenseRequired$ = " | + | ;12)installedmodificationtime= 13)actionrequest=setup |
- | comment " | + | |
- | Sub_free_license | + | |
- | endif | + | |
- | + | ||
- | ;[Sub_free_license] | + | |
- | ;comment " | + | |
- | + | ||
- | ;comment " | + | |
- | ; | + | |
- | ;Set $result$ = FreeLicense($LicensePool$) | + | |
- | ; If there is an assignment of a license pool to the product, it is possible to use | + | |
- | ; Set $result$ | + | |
- | ; | + | |
- | ; If there is an assignment of a license pool to a windows software | + | |
- | ; DefVar $WindowsSoftwareId$ | + | |
- | ; $WindowsSoftwareId$ | + | |
- | ; set $result$ | + | |
- | </ | + | |
- | + | ||
- | ===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$ | + | |
- | ; informations to exit codes see | + | |
- | ; http://msdn.microsoft.com/ | + | |
- | ; 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 | + | |
+ | DefVar | ||
+ | Set | ||
+ | DefVar | ||
+ | Set | ||
+ | DefVar | ||
+ | Set | ||
+ | DefVar | ||
+ | Set | ||
+ | DefVar | ||
+ | Set | ||
+ | DefVar | ||
+ | Set | ||
+ | DefVar | ||
+ | Set | ||
+ | DefVar | ||
+ | Set | ||
+ | DefVar | ||
+ | Set | ||
+ | DefVar | ||
+ | Set | ||
+ | DefVar | ||
+ | Set | ||
+ | DefVar | ||
+ | Set | ||
+ | DefVar | ||
+ | Set | ||
+ | DefVar | ||
+ | Set | ||
</ | </ | ||
- | ===killtask.ins=== | + | ==== sample |
- | <code winst> | + | |
- | [Actions] | + | |
- | setloglevel | + | |
- | 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]] | + | |
- | + | ||
- | ==== setup.ins ==== | + | |
<code winst> | <code winst> | ||
- | click on "edit this page" | + | set $Setupfile$ = "ownCloud-" |
</ | </ | ||
- | |||
- | ==== uninstall.ins ==== | ||
- | <code winst> | ||
- | click on "edit this page" to see the complete source. | ||
- | </ | ||
- | |||
- | ==== 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. | ||
- | </ | ||
- | |||