Add new 32bit templates

This commit is contained in:
Mario Fetka
2019-10-30 14:43:12 +01:00
parent 766a1e5c3f
commit 1e74dc498d
144 changed files with 12142 additions and 304 deletions

View File

@@ -0,0 +1,53 @@
; Opsi Builder to automate the creation of Opsi packages for the Opsi System
; Copyright (C) 2012 Daniel Schwager
; Copyright (C) 2014 Mario Fetka
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU Affero General Public License as
; published by the Free Software Foundation, either version 3 of the
; License, or (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU Affero General Public License for more details.
;
; You should have received a copy of the GNU Affero General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
[ExecWith_BrowserKill]
Option Explicit
KillBrowsers()
Sub KillBrowsers()
'Declare variables
Dim i
Dim wmiSvc,WQL,Processes,Process
Dim arrBrowserProcesses(9)
'Initialize variables
arrBrowserProcesses(0)="iexplore.exe"
arrBrowserProcesses(1)="chrome.exe"
arrBrowserProcesses(2)="firefox.exe"
arrBrowserProcesses(3)="safari.exe"
arrBrowserProcesses(4)="opera.exe"
arrBrowserProcesses(5)="vivaldi.exe"
arrBrowserProcesses(6)="iron.exe"
arrBrowserProcesses(7)="MicrosoftEdge.exe"
arrBrowserProcesses(8)="msedge.exe"
Set wmiSvc = GetObject("winmgmts:\\.\root\cimv2")
For i = 0 To UBound(arrBrowserProcesses)
wql = "SELECT * FROM Win32_Process WHERE Name='" & arrBrowserProcesses(i) & "'"
Set processes = wmiSvc.ExecQuery(wql)
Do While processes.Count > 0
For Each process In processes
process.Terminate
Next
WScript.Sleep 200
Set processes = wmiSvc.ExecQuery(wql)
Loop
Next
End Sub

View File

@@ -0,0 +1,53 @@
;Request ExitCode from last Program
set $ExitCode$ = getLastExitCode
;Modify Loglevel
setLogLevel = 4
;Check ExitCode
if ($ExitCode$ = "0")
setLogLevel = 5
comment "ExitCode = "+$ExitCode$+" Setup was successfully run to completion."
setLogLevel = 4
endif
if ($ExitCode$ = "1")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" Setup failed to initialize."
isFatalError
endif
if ($ExitCode$ = "2")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" The user clicked Cancel in the wizard before the actual installation started, or chose "No" on the opening "This will install..." message box."
isFatalError
endif
if ($ExitCode$ = "3")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" A fatal error occurred while preparing to move to the next installation phase (for example, from displaying the pre-installation wizard pages to the actual installation process). This should never happen except under the most unusual of circumstances, such as running out of memory or Windows resources."
isFatalError
endif
if ($ExitCode$ = "4")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" A fatal error occurred during the actual installation process."
isFatalError
endif
if ($ExitCode$ = "5")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" The user clicked Cancel during the actual installation process, or chose Abort at an Abort-Retry-Ignore box."
isFatalError
endif
if ($ExitCode$ = "6")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" The Setup process was forcefully terminated by the debugger (Run | Terminate was used in the IDE)."
isFatalError
endif
;Modify Loglevel
setLogLevel = 6

View File

@@ -0,0 +1,92 @@
;Request Exitcode of last Program
set $ExitCode$ = getLastExitCode
;Modify Loglevel
setLogLevel = 4
;Check ExitCode
if ($ExitCode$ = "0")
setLogLevel = 5
comment "ExitCode = "+$ExitCode$+" Success"
setLogLevel = 4
endif
if ($ExitCode$ = "-1")
logError "ExitCode = "+$ExitCode$+" General error"
isFatalError
endif
if ($ExitCode$ = "-2")
logError "ExitCode = "+$ExitCode$+" Invalid mode"
isFatalError
endif
if ($ExitCode$ = "-3")
logError "ExitCode = "+$ExitCode$+" Required data not found in the Setup.iss file"
isFatalError
endif
if ($ExitCode$ = "-4")
logError "ExitCode = "+$ExitCode$+" Not enough memory available"
isFatalError
endif
if ($ExitCode$ = "-5")
logError "ExitCode = "+$ExitCode$+" File does not exist"
isFatalError
endif
if ($ExitCode$ = "-6")
logError "ExitCode = "+$ExitCode$+" Cannot write to the response file"
isFatalError
endif
if ($ExitCode$ = "-7")
logError "ExitCode = "+$ExitCode$+" Unable to write to the log file"
isFatalError
endif
if ($ExitCode$ = "-8")
logError "ExitCode = "+$ExitCode$+" Invalid path to the InstallShield Silent response file"
isFatalError
endif
if ($ExitCode$ = "-9")
logError "ExitCode = "+$ExitCode$+" Not a valid list type (string or number)"
isFatalError
endif
if ($ExitCode$ = "-10")
logError "ExitCode = "+$ExitCode$+" Data type is invalid"
isFatalError
endif
if ($ExitCode$ = "-11")
logError "ExitCode = "+$ExitCode$+" Unknown error during setup"
isFatalError
endif
if ($ExitCode$ = "-12")
logError "ExitCode = "+$ExitCode$+" Dialogs are out of order"
isFatalError
endif
if ($ExitCode$ = "-51")
logError "ExitCode = "+$ExitCode$+" Cannot create the specified folder"
isFatalError
endif
if ($ExitCode$ = "-52")
logError "ExitCode = "+$ExitCode$+" Cannot access the specified file or folder"
isFatalError
endif
if ($ExitCode$ = "-53")
logError "ExitCode = "+$ExitCode$+" Invalid option selected"
isFatalError
endif
;Modify Loglevel
setLogLevel = 6

View File

@@ -0,0 +1,29 @@
;Request ExitCode from last Program
set $ExitCode$ = getLastExitCode
;Modify Loglevel
setLogLevel = 4
;Check ExitCode
if ($ExitCode$ = "0")
setLogLevel = 5
comment "ExitCode = "+$ExitCode$+" Normal execution (no error)"
setLogLevel = 4
endif
if ($ExitCode$ = "1")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" Installation aborted by user (cancel button)"
isFatalError
endif
if ($ExitCode$ = "2")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" Installation aborted by script"
isFatalError
endif
;Modify Loglevel
setLogLevel = 6

View File

@@ -0,0 +1,198 @@
; 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://www.opsi.org/en/credits/
include_append "%ScriptPath%\browserkill.opsiinc"
Set $UninstallProgram$ = $InstallDir$ + "\" + $UninstallExecutable$
Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini"
if FileExists($IniFile$)
Set $OLD_VERSION$ = GetValueFromInifile($IniFile$,"COMMON","VERSION","")
Set $OLD_CREATOR_TAG$ = GetValueFromInifile($IniFile$,"COMMON","CREATOR_TAG","")
Set $OLD_RELEASE$ = GetValueFromInifile($IniFile$,"COMMON","RELEASE","")
Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " ..."
else
Message "Uninstalling " + $ProductId$ + " ..."
endif
if FileExists($IniFile$)
Set $UninstallExecutable$ = GetValueFromInifile($IniFile$,"X86_64","UninstallExecutable","XXXXXXXX.exe")
Set $UninstallProgramOld$ = $InstallDir$ + "\" + $UninstallExecutable$
if FileExists($UninstallProgramOld$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_old
;Sub "%ScriptPath%\check_innosetup-exitcode.opsiscript"
;Sub "%ScriptPath%\check_installshield-exitcode.opsiscript"
;Sub "%ScriptPath%\check_nullsoft-exitcode.opsiscript"
;Sub "%ScriptPath%\check_msi-exitcode.opsiscript"
sub_check_exitcode
;set $Reboot$="1"
endif
endif
if FileExists($UninstallProgram$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall
;Sub "%ScriptPath%\check_innosetup-exitcode.opsiscript"
;Sub "%ScriptPath%\check_installshield-exitcode.opsiscript"
;Sub "%ScriptPath%\check_nullsoft-exitcode.opsiscript"
;Sub "%ScriptPath%\check_msi-exitcode.opsiscript"
sub_check_exitcode
;set $Reboot$="1"
endif
if FileExists($IniFile$)
Set $MsiIdOld$ = GetValueFromInifile($IniFile$,"X86_64","MsiId","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}")
if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld$ + "] DisplayName") = "")
comment "Old MSI id " + $MsiIdOld$ + " found in registry, starting msiexec to uninstall old version"
Winbatch_uninstall_msi_old
;Sub "%ScriptPath%\check_innosetup-exitcode.opsiscript"
;Sub "%ScriptPath%\check_installshield-exitcode.opsiscript"
;Sub "%ScriptPath%\check_nullsoft-exitcode.opsiscript"
;Sub "%ScriptPath%\check_msi-exitcode.opsiscript"
sub_check_exitcode
;set $Reboot$="1"
endif
endif
if not (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId$ + "] DisplayName") = "")
comment "MSI id " + $MsiId$ + " found in registry, starting msiexec to uninstall"
Winbatch_uninstall_msi
;Sub "%ScriptPath%\check_innosetup-exitcode.opsiscript"
;Sub "%ScriptPath%\check_installshield-exitcode.opsiscript"
;Sub "%ScriptPath%\check_nullsoft-exitcode.opsiscript"
;Sub "%ScriptPath%\check_msi-exitcode.opsiscript"
sub_check_exitcode
;set $Reboot$="1"
endif
;comment "Kill Web Browser"
;ExecWith_BrowserKill %System%\cscript.exe //b //nologo
comment "Delete files"
Files_uninstall /64Bit
comment "Cleanup registry"
Registry_uninstall /64Bit
comment "Delete program shortcuts"
LinkFolder_uninstall
Set $Property_FileTypeAssociation$ = GetProductProperty("FileTypeAssociation","true")
if ($Property_FileTypeAssociation$ = "true")
comment "File Type Association"
DosInAnIcon_FileTypeAssoc_uninstall
endif
DefVar $Property_CustomPostUninstall$
Set $Property_CustomPostUninstall$ = getProductProperty("custom-post-uninstall","none")
if not ($Property_CustomPostUninstall$ = "none")
comment "Include custom post uninstall file"
if FileExists("%ScriptPath%\custom\" + $Property_CustomPostUninstall$)
sub_CustomPostUninstall
else
LogError "Include script NOT exists (" + $Property_CustomPostUninstall$ +")"
endif
endif
if $Reboot$="1"
ExitWindows /ImmediateReboot
endif
[Winbatch_uninstall_old]
; Choose one of the following examples as basis for program uninstall
;
; === Nullsoft Scriptable Install System ================================================================
; maby better Call as
; Winbatch_uninstall /WaitforProcessending "Au_.exe" /Timeoutseconds 10
; "$UninstallProgramOld$" /S
;
; === Inno Setup ========================================================================================
; "$UninstallProgramOld$" /silent /norestart /SUPPRESSMSGBOXES /nocancel
[Winbatch_uninstall]
; Choose one of the following examples as basis for program uninstall
;
; === Nullsoft Scriptable Install System ================================================================
; maby better Call as
; Winbatch_uninstall /WaitforProcessending "Au_.exe" /Timeoutseconds 10
; "$UninstallProgram$" /S
;
; === Inno Setup ========================================================================================
; "$UninstallProgram$" /silent /norestart /SUPPRESSMSGBOXES /nocancel
[Winbatch_uninstall_msi_old]
msiexec /x $MsiIdOld$ /qb-! REBOOT=ReallySuppress
[Winbatch_uninstall_msi]
msiexec /x $MsiId$ /qb-! REBOOT=ReallySuppress
[Files_uninstall]
; Example for recursively deleting the installation directory:
;
; del -sf "$InstallDir$\"
[Registry_uninstall]
; Example of deleting a registry key:
;
; deletekey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
[LinkFolder_uninstall]
set_basefolder common_desktopdirectory
set_subfolder ""
delete_element $NAME$
; 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$
[DosInAnIcon_FileTypeAssoc_uninstall]
; Requires danysys.sfta
; Sample Usage:
; Set Acrobat Reader DC as Default .pdf reader:
;
; SFTA --unreg AcroExch.Document.DC .pdf
;
; Set Sumatra PDF as Default .pdf reader:
;
; SFTA --unreg Applications\SumatraPDF.exe .pdf
[sub_CustomPostUninstall]
include_insert "%ScriptPath%\custom\" + $Property_CustomPostUninstall$
[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
comment "Looks good: setup program gives exitcode zero"
else
comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
if ($ExitCode$ = "1605")
comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed."
comment "Uninstall of a not installed product failed - no problem"
else
if ($ExitCode$ = "1641")
comment "looks good: setup program gives exitcode 1641"
comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success."
else
if ($ExitCode$ = "3010")
comment "looks good: setup program gives exitcode 3010"
comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success."
else
logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
isFatalError
endif
endif
endif
endif

View File

@@ -0,0 +1,24 @@
; 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://www.opsi.org/en/credits/
[Actions]
Message "Profile Patch for VLC ...."
comment "Did we run this script before ? - and set version stamp in profile"
if getValue("installationstate", getProductMap) = "installed"
comment "Product is installed"
if not (scriptWasExecutedBefore)
comment "loginscript was not run yet "
Files_profile_copy
Registry_currentuser_set
endif
endif
[Files_profile_copy]
copy "%Scriptpath%\profiles\*.*" "%CurrentAppdataDir%\ACME"
[Registry_currentuser_set]
openkey [HKCU\Software\ACME]
set "show_greeting_window" = "no"

View File

@@ -1,10 +1,6 @@
[X86]
MsiId={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
MsiId32={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
[X86_64]
MsiId={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
MsiId64={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
[COMMON]
PN=name

View File

@@ -0,0 +1,340 @@
; 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://www.opsi.org/en/credits/
[Actions]
requiredWinstVersion >= "4.11.4.6"
ScriptErrorMessages=off
include_append "%ScriptPath%\browserkill.opsiinc"
DefVar $MsiIdOld$
DefVar $UninstallProgram$
DefVar $UninstallProgramOld$
DefVar $IniFile$
DefVar $IniCfgFile$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
DefVar $Reboot$
DefVar $CheckOsVersion$
DefStringList $languageInfo$
set $languageInfo$ = getLocaleInfoMap
DefVar $LanguageId$
set $LanguageId$ = getValue("default_language_id_decimal", $languageInfo$)
;Property Variables
DefVar $Property_CustomPostInstall$
DefVar $Property_DesktopLink$
DefVar $Property_FileTypeAssociation$
Set $LogDir$ = "%opsiLogDir%"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
; and adds the following variables:
; from builder-product.cfg : all variables definded by attribute WINST[index]
; from builder-product.cfg : VENDOR PN VERSION RELEASE PRIORITY ADVICE TYPE
; from opsi-builder.cfg : CREATOR_TAG CREATOR_NAME CREATOR_EMAIL
; auto generated winst-variables
; $IconFile$: path to product picture
;
@@BUILDER_VARIABLES@@
; -----------------------------------------------------
; Minimal Supported OS (comment all other entries)
set $CheckOsVersion$ = "5.1" ; Windows XP
; set $CheckOsVersion$ = "5.2" ; Windows XP 64
; set $CheckOsVersion$ = "6.0" ; Windows Vista
; set $CheckOsVersion$ = "6.1" ; Windows 7
; set $CheckOsVersion$ = "6.2" ; Windows 8
; set $CheckOsVersion$ = "6.3" ; Windows 8.1
; set $CheckOsVersion$ = "10.0" ; Windows 10
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
;$ProductId$ should be the name of the product in opsi
; therefore please: only lower letters, no umlauts,
; no white space use '-' as a seperator
Set $MinimumSpace$ = "1 MB"
; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles64Dir%\<path to the product>"
Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$
; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
; Check Minimalen OS Version
if not(CompareDotSeparatedNumbers(GetMsVersionInfo, ">=", $CheckOsVersion$) AND GetSystemType = "64 bit System")
LogError "This Operating System (" + GetNtVersion + " " + GetSystemType + ") is not supported by this Product (" + $ProductId$ + ")!"
isFatalError
endif
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
isFatalError
; Stop process and set installation status to failed
else
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
if FileExists("%ScriptPath%\delsub64.opsiscript")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub64.opsiscript"
endif
Message "Installing " + $ProductId$ + " "+ $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " ..."
if $LicenseRequired$ = "true"
comment "Licensing required, reserve license and get license key"
Sub_get_licensekey
endif
comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%"
Winbatch_install
;Sub "%ScriptPath%\check_innosetup-exitcode.opsiscript"
;Sub "%ScriptPath%\check_installshield-exitcode.opsiscript"
;Sub "%ScriptPath%\check_nullsoft-exitcode.opsiscript"
;Sub "%ScriptPath%\check_msi-exitcode.opsiscript"
Sub_check_exitcode
;comment "Kill Web Browser"
;ExecWith_BrowserKill %System%\cscript.exe //b //nologo
comment "Disable Update check"
DosInAnIcon_DisableUpdate
comment "Copy files"
Files_install /64Bit
comment "Patch Registry"
Registry_install /64Bit
comment "Create shortcuts"
LinkFolder_install
Set $Property_DesktopLink$ = GetProductProperty("DesktopLink","false")
if ($Property_DesktopLink$ = "true")
LinkFolder_install_DesktopLink
endif
Set $Property_FileTypeAssociation$ = GetProductProperty("FileTypeAssociation","true")
if ($Property_FileTypeAssociation$ = "true")
comment "File Type Association"
DosInAnIcon_FileTypeAssoc_install
endif
Set $Property_CustomPostInstall$ = getProductProperty("custom-post-install","none")
if not ($Property_CustomPostInstall$ = "none")
comment "Include custom post install file"
if FileExists("%ScriptPath%\custom\" + $Property_CustomPostInstall$)
sub_CustomPostInstall
else
LogError "Include script NOT exists (" + $Property_CustomPostInstall$ +")"
endif
endif
endif
[Winbatch_install]
; Choose one of the following examples as basis for your installation
; You can use $LicenseKey$ var to pass a license key to the installer
;
; === Nullsoft Scriptable Install System ================================================================
; "%ScriptPath%\Setup.exe" /S
;
; === MSI package =======================================================================================
; You may use the parameter PIDKEY=$Licensekey$
; msiexec /i "%ScriptPath%\some.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb-! ALLUSERS=1 REBOOT=ReallySuppress
;
; === InstallShield + MSI=====================================================================================
; Attention: The path to the log file should not contain any whitespaces
; "%ScriptPath%\setup.exe" /s /v" /l* $LogDir$\$ProductId$.install_log.txt /qb-! ALLUSERS=1 REBOOT=ReallySuppress"
; "%ScriptPath%\setup.exe" /s /v" /qb-! ALLUSERS=1 REBOOT=ReallySuppress"
;
; === InstallShield =====================================================================================
; Create setup.iss answer file by running: setup.exe /r /f1"c:\setup.iss"
; You may use an answer file by the parameter /f1"c:\setup.iss"
; "%ScriptPath%\setup.exe" /s /sms /f2"$LogDir$\$ProductId$.install_log.txt"
;
; === Inno Setup ========================================================================================
; http://unattended.sourceforge.net/InnoSetup_Switches_ExitCodes.html
; You may create setup answer file by: setup.exe /SAVEINF="filename"
; You may use an answer file by the parameter /LOADINF="filename"
; "%ScriptPath%\setup.exe" /sp- /silent /norestart /nocancel /SUPPRESSMSGBOXES
[Files_install]
; copy the ini file to the InstallDir
copy "$IniCfgFile$" "$InstallDir$"
; Example of recursively copying some files into the installation directory:
;
; copy -s "%ScriptPath%\files\*.*" "$InstallDir$"
[Registry_install]
; Example of setting some values of an registry key:
;
; openkey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
; set "name1" = "some string value"
; set "name2" = REG_DWORD:0001
; set "name3" = REG_BINARY:00 af 99 cd
[LinkFolder_install]
set_basefolder common_desktopdirectory
set_subfolder ""
delete_element "$NAME$"
; Example of deleting a folder from AllUsers startmenu:
;
; set_basefolder common_programs
; delete_subfolder $ProductId$
;
; Example of creating an shortcut to the installed exe in AllUsers startmenu:
;
; set_basefolder common_programs
; set_subfolder $ProductId$
;
; set_link
; name: $ProductId$
; target: <path to the program>
; parameters:
; working_dir: $InstallDir$
; icon_file:
; icon_index:
; end_link
;
; Example of creating an shortcut to the installed exe on AllUsers desktop:
;
; set_basefolder common_desktopdirectory
; set_subfolder ""
;
; set_link
; name: $ProductId$
; target: <path to the program>
; parameters: <some_param>
; working_dir: $InstallDir$
; icon_file: <path to icon file>
; icon_index: 2
; end_link
[LinkFolder_install_DesktopLink]
;
; Example of creating an shortcut to the installed exe on AllUsers desktop:
;
set_basefolder common_desktopdirectory
set_subfolder ""
;
set_link
name: $NAME$
target: "$InstallDir$\$ProgramExecutable$"
parameters:
working_dir: $InstallDir$
icon_file:
icon_index:
end_link
[DosInAnIcon_FileTypeAssoc_install]
; Requires danysys.sfta
; Sample Usage:
; Set Acrobat Reader DC as Default .pdf reader:
;
; SFTA AcroExch.Document.DC .pdf
;
; Set Sumatra PDF as Default .pdf reader:
;
; SFTA Applications\SumatraPDF.exe .pdf
[DosInAnIcon_DisbaleUpdate]
; Requires horstmuc.inifile
;
; inifile "$InstallDir$\custom.ini" [Updater] AutoUpdate=0
; Requires sourceforge.xmlstarlet
;
; Update value of an attribute
; xml ed -u "/xml/table/rec[@id=3]/@id" -v 5 "$InstallDir$\config.xml"> "$InstallDir$\config.model.xml"
; Update value of an element
; xml ed -u "/xml/table/rec[@id=1]/numField" -v 0 "$InstallDir$\config.xml"> "$InstallDir$\config.model.xml"
[sub_CustomPostInstall]
include_insert "%ScriptPath%\custom\" + $Property_CustomPostInstall$
[Sub_get_licensekey]
if opsiLicenseManagementEnabled
comment "License management is enabled and will be used"
comment "Trying to get a 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 ("", $ProductId$)
;
; 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 ("", "", $WindowsSoftwareId$)
DefVar $ServiceErrorClass$
set $ServiceErrorClass$ = getLastServiceErrorClass
comment "Error class: " + $ServiceErrorClass$
if $ServiceErrorClass$ = "None"
comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
else
if $ServiceErrorClass$ = "LicenseConfigurationError"
LogError "Fatal: license configuration must be corrected"
LogError getLastServiceErrorMessage
isFatalError
else
if $ServiceErrorClass$ = "LicenseMissingError"
LogError "Fatal: required license is not supplied"
isFatalError
endif
endif
endif
else
LogError "Fatal: license required, but license management not enabled"
isFatalError
endif
[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
comment "Looks good: setup program gives exitcode zero"
else
comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
if ($ExitCode$ = "1605")
comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed."
comment "Uninstall of a not installed product failed - no problem"
else
if ($ExitCode$ = "1641")
comment "looks good: setup program gives exitcode 1641"
comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success."
else
if ($ExitCode$ = "3010")
comment "looks good: setup program gives exitcode 3010"
comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success."
else
logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
isFatalError
endif
endif
endif
endif

View File

@@ -0,0 +1,80 @@
; 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://www.opsi.org/en/credits/
[Actions]
requiredWinstVersion >= "4.11.4.6"
ScriptErrorMessages=off
DefVar $MsiIdOld$
DefVar $UninstallProgram$
DefVar $UninstallProgramOld$
DefVar $IniFile$
DefVar $IniCfgFile$
DefVar $LogDir$
DefVar $ExitCode$
DefVar $ProductId$
DefVar $InstallDir$
DefVar $LicenseRequired$
DefVar $LicensePool$
DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
DefVar $Reboot$
DefVar $Property_FileTypeAssociation$
Set $LogDir$ = "%opsiLogDir%"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
; and adds the following variables:
; from builder-product.cfg : all variables definded by attribute WINST[index]
; from builder-product.cfg : VENDOR PN VERSION RELEASE PRIORITY ADVICE TYPE
; from opsi-builder.cfg : CREATOR_TAG CREATOR_NAME CREATOR_EMAIL
; auto generated winst-variables
; $IconFile$: path to product picture
;
@@BUILDER_VARIABLES@@
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
Set $InstallDir$ = "%ProgramFiles64Dir%\<path to the product>"
Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$
; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
Message "Uninstalling " + $ProductId$ + " ..."
if FileExists("%ScriptPath%\delsub64.opsiscript")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub64.opsiscript"
endif
if $LicenseRequired$ = "true"
comment "Licensing required, free license used"
Sub_free_license
endif
[Sub_free_license]
comment "License management is enabled and will be used"
comment "Trying to free license used for the product"
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("", $ProductId$)
;
; 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("", "", $WindowsSoftwareId$)

View File

@@ -1,5 +1,5 @@
[Package]
version: 2
version: 1
depends:
incremental: False
@@ -9,17 +9,56 @@ id: opsi-template
name: opsi template product
description: A template for opsi products
advice:
version: 4.0.2
version: 4.0.6
priority: 0
licenseRequired: True
licenseRequired: False
productClasses:
setupScript: setup64.ins
uninstallScript: uninstall64.ins
setupScript: setup32.opsiscript
uninstallScript: uninstall32.opsiscript
updateScript:
alwaysScript:
onceScript:
customScript:
userLoginScript:
userLoginScript:
[ProductProperty]
type: unicode
name: install_architecture
multivalue: False
editable: False
description: which architecture (32/64 bit) has to be installed
values: ["32 only", "64 only", "both", "system specific"]
default: ["system specific"]
[ProductProperty]
type: bool
name: FileTypeAssociation
description: File Type Associations on/off
default: True
[ProductProperty]
type: bool
name: DesktopLink
description: Show Desktop Link on/off
default: False
[ProductProperty]
type: unicode
name: custom-post-install
multivalue: False
editable: True
description: Define filename for include script in custom directory after installation
values: ["none"]
default: ["none"]
[ProductProperty]
type: unicode
name: custom-post-uninstall
multivalue: False
editable: True
description: Define filename for include script in custom directory after uninstallation
values: ["none"]
default: ["none"]
[ProductDependency]
action: setup
@@ -27,4 +66,9 @@ requiredProduct: sereby.aio
requiredStatus: installed
requirementType: before
[ProductDependency]
action: setup
requiredProduct: danysys.sfta
requiredStatus: installed
requirementType: before

View File

@@ -7,3 +7,19 @@
# PRODUCT_ID: id of the current product
# CLIENT_DATA_DIR: directory which contains the installed client data
#
TMP_DIR=${CLIENT_DATA_DIR}/../${PRODUCT_ID}.tmp
if [ -d $TMP_DIR ]; then
echo 'Restoring previous directories...'
echo 'Restoring previous custom dir...'
if [ -d $TMP_DIR/custom ]; then
test -e $CLIENT_DATA_DIR/custom && rm -rf $CLIENT_DATA_DIR/custom
echo " moving $TMP_DIR/custom to $CLIENT_DATA_DIR/"
mv $TMP_DIR/custom $CLIENT_DATA_DIR/ || exit 1
fi
fi
echo "Removing temporary files..."
rm -rf $TMP_DIR

View File

@@ -7,3 +7,27 @@
# PRODUCT_ID: id of the current product
# CLIENT_DATA_DIR: directory where client data will be installed
#
TMP_DIR=${CLIENT_DATA_DIR}/../${PRODUCT_ID}.tmp
if [ -d $TMP_DIR ]; then
echo "Temporary directory $TMP_DIR already exist, aborting!" 1>&2
exit 1
fi
[ ! -d $CLIENT_DATA_DIR ] && mkdir $CLIENT_DATA_DIR
mkdir $TMP_DIR
if [ -d $CLIENT_DATA_DIR ]; then
echo "Saving previous directories..."
for dirname in custom ; do
for path in $CLIENT_DATA_DIR/$dirname; do
if [ -e $path ]; then
echo " moving $path to $TMP_DIR"
mv $path $TMP_DIR/ || exit 1
fi
done
done
fi
exit 0

View File

@@ -58,7 +58,7 @@ TYPE="public"
# - Compression format
# If the retrieved file is compressed, the compression format is specified to
# extract it. If the parameter is not set, no extraction happens
# Optional parameter. Valid values: unzip, 7zip. Default value: <not set>.
# Optional parameter. Valid values: unzip, 7zip, unrar, lha, targz, tarbz2, cab . Default value: <not set>.
# DL_EXTRACT_FORMAT="zip"
#
# - Extraction directory for compressed files
@@ -98,6 +98,26 @@ DL_EXTRACT_TO[3]="office"
# File array index for the image showing while installing the program
ICON_DL_INDEX=0
#######################################
# specify Executable for Desktop link
#######################################
on 32bit or 64bit packages
WINST_NAME[0]="ProgramExecutable"
WINST_VALUE[0]="7z.exe"
######################################
on the dual arch package
WINST_NAME[0]="ProgramExecutable32"
WINST_VALUE[0]="7z.exe"
# AND
WINST_NAME[1]="ProgramExecutable64"
WINST_VALUE[1]="7z.exe"
#########################
# Setup additional, custom WINST variables
# which will be injected to the *.ins files (replaces token @@BUILDER_VARIABLES@@ )
@@ -110,11 +130,11 @@ ICON_DL_INDEX=0
# results in "%ScriptPath%\X86_64\svcpack\aio-runtimes.exe"
#
#########################
WINST_NAME[0]="InstallExe"
WINST_VALUE[0]="@DL_EXTRACT_WINST_PATH[2]@\\svcpack\\aio-runtimes.exe"
WINST_NAME[1]="InstallExe"
WINST_VALUE[1]="@DL_EXTRACT_WINST_PATH[2]@\\svcpack\\aio-runtimes.exe"
WINST_NAME[1]="MyVar"
WINST_VALUE[1]="My content"
WINST_NAME[2]="MyVar"
WINST_VALUE[3]="My content"
#########################
# Setup required OPSI_INI variables
@@ -124,27 +144,54 @@ WINST_VALUE[1]="My content"
# !!! These Variables are requred if you remove them in this cfg file you will get error's about not defined Variables !!!
#
#########################
# if the packaga just supports X86 OR X86_64 (setupXX.ins delsubXX.ins uninstallXX.ins) then you have to just specify one UninstallProg
# if the packaga just supports X86 OR X86_64 (setupXX.ins delsubXX.ins uninstallXX.ins) then you have to just specify one MsiId
##### Msi ######
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="UninstallProg"
OPSI_INI_OPTION[0]="MsiId"
OPSI_INI_VALUE[0]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
# OR
OPSI_INI_SECTION[0]="X86_64"
OPSI_INI_OPTION[0]="UninstallProg"
OPSI_INI_OPTION[0]="MsiId"
OPSI_INI_VALUE[0]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
# if the package supports X86 AND X86_64 (setup3264.ins delsub3264.ins uninstall3264.ins) then you have to specify 2 UninstallProg's
##### Installer ##############
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="UninstallProg32"
OPSI_INI_OPTION[0]="UninstallExecutable"
OPSI_INI_VALUE[0]="uninstall.exe"
# OR
OPSI_INI_SECTION[1]="X86_64"
OPSI_INI_OPTION[1]="UninstallExecutable"
OPSI_INI_VALUE[1]="uninstall.exe"
# if the package supports X86 AND X86_64 (setup3264.ins delsub3264.ins uninstall3264.ins) then you have to specify 2 MsiId's or UninstallProg's
##### Msi ######
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="MsiId32"
OPSI_INI_VALUE[0]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
# AND
OPSI_INI_SECTION[1]="X86_64"
OPSI_INI_OPTION[1]="UninstallProg64"
OPSI_INI_OPTION[1]="MsiId64"
OPSI_INI_VALUE[1]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
##### Installer ##############
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="UninstallExecutable32"
OPSI_INI_VALUE[0]="uninstall.exe"
# AND
OPSI_INI_SECTION[1]="X86_64"
OPSI_INI_OPTION[1]="UninstallExecutable64"
OPSI_INI_VALUE[1]="uninstall.exe"

View File

@@ -0,0 +1,53 @@
; Opsi Builder to automate the creation of Opsi packages for the Opsi System
; Copyright (C) 2012 Daniel Schwager
; Copyright (C) 2014 Mario Fetka
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU Affero General Public License as
; published by the Free Software Foundation, either version 3 of the
; License, or (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU Affero General Public License for more details.
;
; You should have received a copy of the GNU Affero General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
[ExecWith_BrowserKill]
Option Explicit
KillBrowsers()
Sub KillBrowsers()
'Declare variables
Dim i
Dim wmiSvc,WQL,Processes,Process
Dim arrBrowserProcesses(9)
'Initialize variables
arrBrowserProcesses(0)="iexplore.exe"
arrBrowserProcesses(1)="chrome.exe"
arrBrowserProcesses(2)="firefox.exe"
arrBrowserProcesses(3)="safari.exe"
arrBrowserProcesses(4)="opera.exe"
arrBrowserProcesses(5)="vivaldi.exe"
arrBrowserProcesses(6)="iron.exe"
arrBrowserProcesses(7)="MicrosoftEdge.exe"
arrBrowserProcesses(8)="msedge.exe"
Set wmiSvc = GetObject("winmgmts:\\.\root\cimv2")
For i = 0 To UBound(arrBrowserProcesses)
wql = "SELECT * FROM Win32_Process WHERE Name='" & arrBrowserProcesses(i) & "'"
Set processes = wmiSvc.ExecQuery(wql)
Do While processes.Count > 0
For Each process In processes
process.Terminate
Next
WScript.Sleep 200
Set processes = wmiSvc.ExecQuery(wql)
Loop
Next
End Sub

View File

@@ -0,0 +1,53 @@
;Request ExitCode from last Program
set $ExitCode$ = getLastExitCode
;Modify Loglevel
setLogLevel = 4
;Check ExitCode
if ($ExitCode$ = "0")
setLogLevel = 5
comment "ExitCode = "+$ExitCode$+" Setup was successfully run to completion."
setLogLevel = 4
endif
if ($ExitCode$ = "1")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" Setup failed to initialize."
isFatalError
endif
if ($ExitCode$ = "2")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" The user clicked Cancel in the wizard before the actual installation started, or chose "No" on the opening "This will install..." message box."
isFatalError
endif
if ($ExitCode$ = "3")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" A fatal error occurred while preparing to move to the next installation phase (for example, from displaying the pre-installation wizard pages to the actual installation process). This should never happen except under the most unusual of circumstances, such as running out of memory or Windows resources."
isFatalError
endif
if ($ExitCode$ = "4")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" A fatal error occurred during the actual installation process."
isFatalError
endif
if ($ExitCode$ = "5")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" The user clicked Cancel during the actual installation process, or chose Abort at an Abort-Retry-Ignore box."
isFatalError
endif
if ($ExitCode$ = "6")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" The Setup process was forcefully terminated by the debugger (Run | Terminate was used in the IDE)."
isFatalError
endif
;Modify Loglevel
setLogLevel = 6

View File

@@ -0,0 +1,92 @@
;Request Exitcode of last Program
set $ExitCode$ = getLastExitCode
;Modify Loglevel
setLogLevel = 4
;Check ExitCode
if ($ExitCode$ = "0")
setLogLevel = 5
comment "ExitCode = "+$ExitCode$+" Success"
setLogLevel = 4
endif
if ($ExitCode$ = "-1")
logError "ExitCode = "+$ExitCode$+" General error"
isFatalError
endif
if ($ExitCode$ = "-2")
logError "ExitCode = "+$ExitCode$+" Invalid mode"
isFatalError
endif
if ($ExitCode$ = "-3")
logError "ExitCode = "+$ExitCode$+" Required data not found in the Setup.iss file"
isFatalError
endif
if ($ExitCode$ = "-4")
logError "ExitCode = "+$ExitCode$+" Not enough memory available"
isFatalError
endif
if ($ExitCode$ = "-5")
logError "ExitCode = "+$ExitCode$+" File does not exist"
isFatalError
endif
if ($ExitCode$ = "-6")
logError "ExitCode = "+$ExitCode$+" Cannot write to the response file"
isFatalError
endif
if ($ExitCode$ = "-7")
logError "ExitCode = "+$ExitCode$+" Unable to write to the log file"
isFatalError
endif
if ($ExitCode$ = "-8")
logError "ExitCode = "+$ExitCode$+" Invalid path to the InstallShield Silent response file"
isFatalError
endif
if ($ExitCode$ = "-9")
logError "ExitCode = "+$ExitCode$+" Not a valid list type (string or number)"
isFatalError
endif
if ($ExitCode$ = "-10")
logError "ExitCode = "+$ExitCode$+" Data type is invalid"
isFatalError
endif
if ($ExitCode$ = "-11")
logError "ExitCode = "+$ExitCode$+" Unknown error during setup"
isFatalError
endif
if ($ExitCode$ = "-12")
logError "ExitCode = "+$ExitCode$+" Dialogs are out of order"
isFatalError
endif
if ($ExitCode$ = "-51")
logError "ExitCode = "+$ExitCode$+" Cannot create the specified folder"
isFatalError
endif
if ($ExitCode$ = "-52")
logError "ExitCode = "+$ExitCode$+" Cannot access the specified file or folder"
isFatalError
endif
if ($ExitCode$ = "-53")
logError "ExitCode = "+$ExitCode$+" Invalid option selected"
isFatalError
endif
;Modify Loglevel
setLogLevel = 6

View File

@@ -0,0 +1,29 @@
;Request ExitCode from last Program
set $ExitCode$ = getLastExitCode
;Modify Loglevel
setLogLevel = 4
;Check ExitCode
if ($ExitCode$ = "0")
setLogLevel = 5
comment "ExitCode = "+$ExitCode$+" Normal execution (no error)"
setLogLevel = 4
endif
if ($ExitCode$ = "1")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" Installation aborted by user (cancel button)"
isFatalError
endif
if ($ExitCode$ = "2")
setLogLevel = 5
logError "ExitCode = "+$ExitCode$+" Installation aborted by script"
isFatalError
endif
;Modify Loglevel
setLogLevel = 6

View File

@@ -0,0 +1,198 @@
; 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://www.opsi.org/en/credits/
include_append "%ScriptPath%\browserkill.opsiinc"
Set $UninstallProgram$ = $InstallDir$ + "\" + $UninstallExecutable$
Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini"
if FileExists($IniFile$)
Set $OLD_VERSION$ = GetValueFromInifile($IniFile$,"COMMON","VERSION","")
Set $OLD_CREATOR_TAG$ = GetValueFromInifile($IniFile$,"COMMON","CREATOR_TAG","")
Set $OLD_RELEASE$ = GetValueFromInifile($IniFile$,"COMMON","RELEASE","")
Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " ..."
else
Message "Uninstalling " + $ProductId$ + " ..."
endif
if FileExists($IniFile$)
Set $UninstallExecutable$ = GetValueFromInifile($IniFile$,"X86_64","UninstallExecutable","XXXXXXXX.exe")
Set $UninstallProgramOld$ = $InstallDir$ + "\" + $UninstallExecutable$
if FileExists($UninstallProgramOld$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_old
;Sub "%ScriptPath%\check_innosetup-exitcode.opsiscript"
;Sub "%ScriptPath%\check_installshield-exitcode.opsiscript"
;Sub "%ScriptPath%\check_nullsoft-exitcode.opsiscript"
;Sub "%ScriptPath%\check_msi-exitcode.opsiscript"
sub_check_exitcode
;set $Reboot$="1"
endif
endif
if FileExists($UninstallProgram$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall
;Sub "%ScriptPath%\check_innosetup-exitcode.opsiscript"
;Sub "%ScriptPath%\check_installshield-exitcode.opsiscript"
;Sub "%ScriptPath%\check_nullsoft-exitcode.opsiscript"
;Sub "%ScriptPath%\check_msi-exitcode.opsiscript"
sub_check_exitcode
;set $Reboot$="1"
endif
if FileExists($IniFile$)
Set $MsiIdOld$ = GetValueFromInifile($IniFile$,"X86_64","MsiId","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}")
if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld$ + "] DisplayName") = "")
comment "Old MSI id " + $MsiIdOld$ + " found in registry, starting msiexec to uninstall old version"
Winbatch_uninstall_msi_old
;Sub "%ScriptPath%\check_innosetup-exitcode.opsiscript"
;Sub "%ScriptPath%\check_installshield-exitcode.opsiscript"
;Sub "%ScriptPath%\check_nullsoft-exitcode.opsiscript"
;Sub "%ScriptPath%\check_msi-exitcode.opsiscript"
sub_check_exitcode
;set $Reboot$="1"
endif
endif
if not (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId$ + "] DisplayName") = "")
comment "MSI id " + $MsiId$ + " found in registry, starting msiexec to uninstall"
Winbatch_uninstall_msi
;Sub "%ScriptPath%\check_innosetup-exitcode.opsiscript"
;Sub "%ScriptPath%\check_installshield-exitcode.opsiscript"
;Sub "%ScriptPath%\check_nullsoft-exitcode.opsiscript"
;Sub "%ScriptPath%\check_msi-exitcode.opsiscript"
sub_check_exitcode
;set $Reboot$="1"
endif
;comment "Kill Web Browser"
;ExecWith_BrowserKill %System%\cscript.exe //b //nologo
comment "Delete files"
Files_uninstall /64Bit
comment "Cleanup registry"
Registry_uninstall /64Bit
comment "Delete program shortcuts"
LinkFolder_uninstall
Set $Property_FileTypeAssociation$ = GetProductProperty("FileTypeAssociation","true")
if ($Property_FileTypeAssociation$ = "true")
comment "File Type Association"
DosInAnIcon_FileTypeAssoc_uninstall
endif
DefVar $Property_CustomPostUninstall$
Set $Property_CustomPostUninstall$ = getProductProperty("custom-post-uninstall","none")
if not ($Property_CustomPostUninstall$ = "none")
comment "Include custom post uninstall file"
if FileExists("%ScriptPath%\custom\" + $Property_CustomPostUninstall$)
sub_CustomPostUninstall
else
LogError "Include script NOT exists (" + $Property_CustomPostUninstall$ +")"
endif
endif
if $Reboot$="1"
ExitWindows /ImmediateReboot
endif
[Winbatch_uninstall_old]
; Choose one of the following examples as basis for program uninstall
;
; === Nullsoft Scriptable Install System ================================================================
; maby better Call as
; Winbatch_uninstall /WaitforProcessending "Au_.exe" /Timeoutseconds 10
; "$UninstallProgramOld$" /S
;
; === Inno Setup ========================================================================================
; "$UninstallProgramOld$" /silent /norestart /SUPPRESSMSGBOXES /nocancel
[Winbatch_uninstall]
; Choose one of the following examples as basis for program uninstall
;
; === Nullsoft Scriptable Install System ================================================================
; maby better Call as
; Winbatch_uninstall /WaitforProcessending "Au_.exe" /Timeoutseconds 10
; "$UninstallProgram$" /S
;
; === Inno Setup ========================================================================================
; "$UninstallProgram$" /silent /norestart /SUPPRESSMSGBOXES /nocancel
[Winbatch_uninstall_msi_old]
msiexec /x $MsiIdOld$ /qb-! REBOOT=ReallySuppress
[Winbatch_uninstall_msi]
msiexec /x $MsiId$ /qb-! REBOOT=ReallySuppress
[Files_uninstall]
; Example for recursively deleting the installation directory:
;
; del -sf "$InstallDir$\"
[Registry_uninstall]
; Example of deleting a registry key:
;
; deletekey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
[LinkFolder_uninstall]
set_basefolder common_desktopdirectory
set_subfolder ""
delete_element $NAME$
; 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$
[DosInAnIcon_FileTypeAssoc_uninstall]
; Requires danysys.sfta
; Sample Usage:
; Set Acrobat Reader DC as Default .pdf reader:
;
; SFTA --unreg AcroExch.Document.DC .pdf
;
; Set Sumatra PDF as Default .pdf reader:
;
; SFTA --unreg Applications\SumatraPDF.exe .pdf
[sub_CustomPostUninstall]
include_insert "%ScriptPath%\custom\" + $Property_CustomPostUninstall$
[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
comment "Looks good: setup program gives exitcode zero"
else
comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
if ($ExitCode$ = "1605")
comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed."
comment "Uninstall of a not installed product failed - no problem"
else
if ($ExitCode$ = "1641")
comment "looks good: setup program gives exitcode 1641"
comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success."
else
if ($ExitCode$ = "3010")
comment "looks good: setup program gives exitcode 3010"
comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success."
else
logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
isFatalError
endif
endif
endif
endif

View File

@@ -0,0 +1,24 @@
; 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://www.opsi.org/en/credits/
[Actions]
Message "Profile Patch for VLC ...."
comment "Did we run this script before ? - and set version stamp in profile"
if getValue("installationstate", getProductMap) = "installed"
comment "Product is installed"
if not (scriptWasExecutedBefore)
comment "loginscript was not run yet "
Files_profile_copy
Registry_currentuser_set
endif
endif
[Files_profile_copy]
copy "%Scriptpath%\profiles\*.*" "%CurrentAppdataDir%\ACME"
[Registry_currentuser_set]
openkey [HKCU\Software\ACME]
set "show_greeting_window" = "no"

View File

@@ -1,10 +1,6 @@
[X86]
MsiId={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
MsiId32={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
[X86_64]
MsiId={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
MsiId64={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
[COMMON]
PN=name

View File

@@ -0,0 +1,340 @@
; 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://www.opsi.org/en/credits/
[Actions]
requiredWinstVersion >= "4.11.4.6"
ScriptErrorMessages=off
include_append "%ScriptPath%\browserkill.opsiinc"
DefVar $MsiIdOld$
DefVar $UninstallProgram$
DefVar $UninstallProgramOld$
DefVar $IniFile$
DefVar $IniCfgFile$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
DefVar $Reboot$
DefVar $CheckOsVersion$
DefStringList $languageInfo$
set $languageInfo$ = getLocaleInfoMap
DefVar $LanguageId$
set $LanguageId$ = getValue("default_language_id_decimal", $languageInfo$)
;Property Variables
DefVar $Property_CustomPostInstall$
DefVar $Property_DesktopLink$
DefVar $Property_FileTypeAssociation$
Set $LogDir$ = "%opsiLogDir%"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
; and adds the following variables:
; from builder-product.cfg : all variables definded by attribute WINST[index]
; from builder-product.cfg : VENDOR PN VERSION RELEASE PRIORITY ADVICE TYPE
; from opsi-builder.cfg : CREATOR_TAG CREATOR_NAME CREATOR_EMAIL
; auto generated winst-variables
; $IconFile$: path to product picture
;
@@BUILDER_VARIABLES@@
; -----------------------------------------------------
; Minimal Supported OS (comment all other entries)
set $CheckOsVersion$ = "5.1" ; Windows XP
; set $CheckOsVersion$ = "5.2" ; Windows XP 64
; set $CheckOsVersion$ = "6.0" ; Windows Vista
; set $CheckOsVersion$ = "6.1" ; Windows 7
; set $CheckOsVersion$ = "6.2" ; Windows 8
; set $CheckOsVersion$ = "6.3" ; Windows 8.1
; set $CheckOsVersion$ = "10.0" ; Windows 10
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
;$ProductId$ should be the name of the product in opsi
; therefore please: only lower letters, no umlauts,
; no white space use '-' as a seperator
Set $MinimumSpace$ = "1 MB"
; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles64Dir%\<path to the product>"
Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$
; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
; Check Minimalen OS Version
if not(CompareDotSeparatedNumbers(GetMsVersionInfo, ">=", $CheckOsVersion$) AND GetSystemType = "64 bit System")
LogError "This Operating System (" + GetNtVersion + " " + GetSystemType + ") is not supported by this Product (" + $ProductId$ + ")!"
isFatalError
endif
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
isFatalError
; Stop process and set installation status to failed
else
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
if FileExists("%ScriptPath%\delsub64.opsiscript")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub64.opsiscript"
endif
Message "Installing " + $ProductId$ + " "+ $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " ..."
if $LicenseRequired$ = "true"
comment "Licensing required, reserve license and get license key"
Sub_get_licensekey
endif
comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%"
Winbatch_install
;Sub "%ScriptPath%\check_innosetup-exitcode.opsiscript"
;Sub "%ScriptPath%\check_installshield-exitcode.opsiscript"
;Sub "%ScriptPath%\check_nullsoft-exitcode.opsiscript"
;Sub "%ScriptPath%\check_msi-exitcode.opsiscript"
Sub_check_exitcode
;comment "Kill Web Browser"
;ExecWith_BrowserKill %System%\cscript.exe //b //nologo
comment "Disable Update check"
DosInAnIcon_DisableUpdate
comment "Copy files"
Files_install /64Bit
comment "Patch Registry"
Registry_install /64Bit
comment "Create shortcuts"
LinkFolder_install
Set $Property_DesktopLink$ = GetProductProperty("DesktopLink","false")
if ($Property_DesktopLink$ = "true")
LinkFolder_install_DesktopLink
endif
Set $Property_FileTypeAssociation$ = GetProductProperty("FileTypeAssociation","true")
if ($Property_FileTypeAssociation$ = "true")
comment "File Type Association"
DosInAnIcon_FileTypeAssoc_install
endif
Set $Property_CustomPostInstall$ = getProductProperty("custom-post-install","none")
if not ($Property_CustomPostInstall$ = "none")
comment "Include custom post install file"
if FileExists("%ScriptPath%\custom\" + $Property_CustomPostInstall$)
sub_CustomPostInstall
else
LogError "Include script NOT exists (" + $Property_CustomPostInstall$ +")"
endif
endif
endif
[Winbatch_install]
; Choose one of the following examples as basis for your installation
; You can use $LicenseKey$ var to pass a license key to the installer
;
; === Nullsoft Scriptable Install System ================================================================
; "%ScriptPath%\Setup.exe" /S
;
; === MSI package =======================================================================================
; You may use the parameter PIDKEY=$Licensekey$
; msiexec /i "%ScriptPath%\some.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb-! ALLUSERS=1 REBOOT=ReallySuppress
;
; === InstallShield + MSI=====================================================================================
; Attention: The path to the log file should not contain any whitespaces
; "%ScriptPath%\setup.exe" /s /v" /l* $LogDir$\$ProductId$.install_log.txt /qb-! ALLUSERS=1 REBOOT=ReallySuppress"
; "%ScriptPath%\setup.exe" /s /v" /qb-! ALLUSERS=1 REBOOT=ReallySuppress"
;
; === InstallShield =====================================================================================
; Create setup.iss answer file by running: setup.exe /r /f1"c:\setup.iss"
; You may use an answer file by the parameter /f1"c:\setup.iss"
; "%ScriptPath%\setup.exe" /s /sms /f2"$LogDir$\$ProductId$.install_log.txt"
;
; === Inno Setup ========================================================================================
; http://unattended.sourceforge.net/InnoSetup_Switches_ExitCodes.html
; You may create setup answer file by: setup.exe /SAVEINF="filename"
; You may use an answer file by the parameter /LOADINF="filename"
; "%ScriptPath%\setup.exe" /sp- /silent /norestart /nocancel /SUPPRESSMSGBOXES
[Files_install]
; copy the ini file to the InstallDir
copy "$IniCfgFile$" "$InstallDir$"
; Example of recursively copying some files into the installation directory:
;
; copy -s "%ScriptPath%\files\*.*" "$InstallDir$"
[Registry_install]
; Example of setting some values of an registry key:
;
; openkey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
; set "name1" = "some string value"
; set "name2" = REG_DWORD:0001
; set "name3" = REG_BINARY:00 af 99 cd
[LinkFolder_install]
set_basefolder common_desktopdirectory
set_subfolder ""
delete_element "$NAME$"
; Example of deleting a folder from AllUsers startmenu:
;
; set_basefolder common_programs
; delete_subfolder $ProductId$
;
; Example of creating an shortcut to the installed exe in AllUsers startmenu:
;
; set_basefolder common_programs
; set_subfolder $ProductId$
;
; set_link
; name: $ProductId$
; target: <path to the program>
; parameters:
; working_dir: $InstallDir$
; icon_file:
; icon_index:
; end_link
;
; Example of creating an shortcut to the installed exe on AllUsers desktop:
;
; set_basefolder common_desktopdirectory
; set_subfolder ""
;
; set_link
; name: $ProductId$
; target: <path to the program>
; parameters: <some_param>
; working_dir: $InstallDir$
; icon_file: <path to icon file>
; icon_index: 2
; end_link
[LinkFolder_install_DesktopLink]
;
; Example of creating an shortcut to the installed exe on AllUsers desktop:
;
set_basefolder common_desktopdirectory
set_subfolder ""
;
set_link
name: $NAME$
target: "$InstallDir$\$ProgramExecutable$"
parameters:
working_dir: $InstallDir$
icon_file:
icon_index:
end_link
[DosInAnIcon_FileTypeAssoc_install]
; Requires danysys.sfta
; Sample Usage:
; Set Acrobat Reader DC as Default .pdf reader:
;
; SFTA AcroExch.Document.DC .pdf
;
; Set Sumatra PDF as Default .pdf reader:
;
; SFTA Applications\SumatraPDF.exe .pdf
[DosInAnIcon_DisbaleUpdate]
; Requires horstmuc.inifile
;
; inifile "$InstallDir$\custom.ini" [Updater] AutoUpdate=0
; Requires sourceforge.xmlstarlet
;
; Update value of an attribute
; xml ed -u "/xml/table/rec[@id=3]/@id" -v 5 "$InstallDir$\config.xml"> "$InstallDir$\config.model.xml"
; Update value of an element
; xml ed -u "/xml/table/rec[@id=1]/numField" -v 0 "$InstallDir$\config.xml"> "$InstallDir$\config.model.xml"
[sub_CustomPostInstall]
include_insert "%ScriptPath%\custom\" + $Property_CustomPostInstall$
[Sub_get_licensekey]
if opsiLicenseManagementEnabled
comment "License management is enabled and will be used"
comment "Trying to get a 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 ("", $ProductId$)
;
; 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 ("", "", $WindowsSoftwareId$)
DefVar $ServiceErrorClass$
set $ServiceErrorClass$ = getLastServiceErrorClass
comment "Error class: " + $ServiceErrorClass$
if $ServiceErrorClass$ = "None"
comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
else
if $ServiceErrorClass$ = "LicenseConfigurationError"
LogError "Fatal: license configuration must be corrected"
LogError getLastServiceErrorMessage
isFatalError
else
if $ServiceErrorClass$ = "LicenseMissingError"
LogError "Fatal: required license is not supplied"
isFatalError
endif
endif
endif
else
LogError "Fatal: license required, but license management not enabled"
isFatalError
endif
[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
comment "Looks good: setup program gives exitcode zero"
else
comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
if ($ExitCode$ = "1605")
comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed."
comment "Uninstall of a not installed product failed - no problem"
else
if ($ExitCode$ = "1641")
comment "looks good: setup program gives exitcode 1641"
comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success."
else
if ($ExitCode$ = "3010")
comment "looks good: setup program gives exitcode 3010"
comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success."
else
logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
isFatalError
endif
endif
endif
endif

View File

@@ -0,0 +1,80 @@
; 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://www.opsi.org/en/credits/
[Actions]
requiredWinstVersion >= "4.11.4.6"
ScriptErrorMessages=off
DefVar $MsiIdOld$
DefVar $UninstallProgram$
DefVar $UninstallProgramOld$
DefVar $IniFile$
DefVar $IniCfgFile$
DefVar $LogDir$
DefVar $ExitCode$
DefVar $ProductId$
DefVar $InstallDir$
DefVar $LicenseRequired$
DefVar $LicensePool$
DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
DefVar $Reboot$
DefVar $Property_FileTypeAssociation$
Set $LogDir$ = "%opsiLogDir%"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
; and adds the following variables:
; from builder-product.cfg : all variables definded by attribute WINST[index]
; from builder-product.cfg : VENDOR PN VERSION RELEASE PRIORITY ADVICE TYPE
; from opsi-builder.cfg : CREATOR_TAG CREATOR_NAME CREATOR_EMAIL
; auto generated winst-variables
; $IconFile$: path to product picture
;
@@BUILDER_VARIABLES@@
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
Set $InstallDir$ = "%ProgramFiles64Dir%\<path to the product>"
Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$
; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
Message "Uninstalling " + $ProductId$ + " ..."
if FileExists("%ScriptPath%\delsub64.opsiscript")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub64.opsiscript"
endif
if $LicenseRequired$ = "true"
comment "Licensing required, free license used"
Sub_free_license
endif
[Sub_free_license]
comment "License management is enabled and will be used"
comment "Trying to free license used for the product"
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("", $ProductId$)
;
; 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("", "", $WindowsSoftwareId$)

View File

@@ -1,5 +1,5 @@
[Package]
version: 2
version: 1
depends:
incremental: False
@@ -9,17 +9,56 @@ id: opsi-template
name: opsi template product
description: A template for opsi products
advice:
version: 4.0.2
version: 4.0.6
priority: 0
licenseRequired: False
productClasses:
setupScript: setup64.ins
uninstallScript: uninstall64.ins
setupScript: setup32.opsiscript
uninstallScript: uninstall32.opsiscript
updateScript:
alwaysScript:
onceScript:
customScript:
userLoginScript:
userLoginScript:
[ProductProperty]
type: unicode
name: install_architecture
multivalue: False
editable: False
description: which architecture (32/64 bit) has to be installed
values: ["32 only", "64 only", "both", "system specific"]
default: ["system specific"]
[ProductProperty]
type: bool
name: FileTypeAssociation
description: File Type Associations on/off
default: True
[ProductProperty]
type: bool
name: DesktopLink
description: Show Desktop Link on/off
default: False
[ProductProperty]
type: unicode
name: custom-post-install
multivalue: False
editable: True
description: Define filename for include script in custom directory after installation
values: ["none"]
default: ["none"]
[ProductProperty]
type: unicode
name: custom-post-uninstall
multivalue: False
editable: True
description: Define filename for include script in custom directory after uninstallation
values: ["none"]
default: ["none"]
[ProductDependency]
action: setup
@@ -27,4 +66,9 @@ requiredProduct: sereby.aio
requiredStatus: installed
requirementType: before
[ProductDependency]
action: setup
requiredProduct: danysys.sfta
requiredStatus: installed
requirementType: before

View File

@@ -7,3 +7,19 @@
# PRODUCT_ID: id of the current product
# CLIENT_DATA_DIR: directory which contains the installed client data
#
TMP_DIR=${CLIENT_DATA_DIR}/../${PRODUCT_ID}.tmp
if [ -d $TMP_DIR ]; then
echo 'Restoring previous directories...'
echo 'Restoring previous custom dir...'
if [ -d $TMP_DIR/custom ]; then
test -e $CLIENT_DATA_DIR/custom && rm -rf $CLIENT_DATA_DIR/custom
echo " moving $TMP_DIR/custom to $CLIENT_DATA_DIR/"
mv $TMP_DIR/custom $CLIENT_DATA_DIR/ || exit 1
fi
fi
echo "Removing temporary files..."
rm -rf $TMP_DIR

View File

@@ -7,3 +7,27 @@
# PRODUCT_ID: id of the current product
# CLIENT_DATA_DIR: directory where client data will be installed
#
TMP_DIR=${CLIENT_DATA_DIR}/../${PRODUCT_ID}.tmp
if [ -d $TMP_DIR ]; then
echo "Temporary directory $TMP_DIR already exist, aborting!" 1>&2
exit 1
fi
[ ! -d $CLIENT_DATA_DIR ] && mkdir $CLIENT_DATA_DIR
mkdir $TMP_DIR
if [ -d $CLIENT_DATA_DIR ]; then
echo "Saving previous directories..."
for dirname in custom ; do
for path in $CLIENT_DATA_DIR/$dirname; do
if [ -e $path ]; then
echo " moving $path to $TMP_DIR"
mv $path $TMP_DIR/ || exit 1
fi
done
done
fi
exit 0

View File

@@ -58,7 +58,7 @@ TYPE="public"
# - Compression format
# If the retrieved file is compressed, the compression format is specified to
# extract it. If the parameter is not set, no extraction happens
# Optional parameter. Valid values: unzip, 7zip. Default value: <not set>.
# Optional parameter. Valid values: unzip, 7zip, unrar, lha, targz, tarbz2, cab . Default value: <not set>.
# DL_EXTRACT_FORMAT="zip"
#
# - Extraction directory for compressed files
@@ -98,6 +98,26 @@ DL_EXTRACT_TO[3]="office"
# File array index for the image showing while installing the program
ICON_DL_INDEX=0
#######################################
# specify Executable for Desktop link
#######################################
on 32bit or 64bit packages
WINST_NAME[0]="ProgramExecutable"
WINST_VALUE[0]="7z.exe"
######################################
on the dual arch package
WINST_NAME[0]="ProgramExecutable32"
WINST_VALUE[0]="7z.exe"
# AND
WINST_NAME[1]="ProgramExecutable64"
WINST_VALUE[1]="7z.exe"
#########################
# Setup additional, custom WINST variables
# which will be injected to the *.ins files (replaces token @@BUILDER_VARIABLES@@ )
@@ -110,11 +130,11 @@ ICON_DL_INDEX=0
# results in "%ScriptPath%\X86_64\svcpack\aio-runtimes.exe"
#
#########################
WINST_NAME[0]="InstallExe"
WINST_VALUE[0]="@DL_EXTRACT_WINST_PATH[2]@\\svcpack\\aio-runtimes.exe"
WINST_NAME[1]="InstallExe"
WINST_VALUE[1]="@DL_EXTRACT_WINST_PATH[2]@\\svcpack\\aio-runtimes.exe"
WINST_NAME[1]="MyVar"
WINST_VALUE[1]="My content"
WINST_NAME[2]="MyVar"
WINST_VALUE[3]="My content"
#########################
# Setup required OPSI_INI variables
@@ -124,27 +144,54 @@ WINST_VALUE[1]="My content"
# !!! These Variables are requred if you remove them in this cfg file you will get error's about not defined Variables !!!
#
#########################
# if the packaga just supports X86 OR X86_64 (setupXX.ins delsubXX.ins uninstallXX.ins) then you have to just specify one UninstallProg
# if the packaga just supports X86 OR X86_64 (setupXX.ins delsubXX.ins uninstallXX.ins) then you have to just specify one MsiId
##### Msi ######
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="UninstallProg"
OPSI_INI_OPTION[0]="MsiId"
OPSI_INI_VALUE[0]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
# OR
OPSI_INI_SECTION[0]="X86_64"
OPSI_INI_OPTION[0]="UninstallProg"
OPSI_INI_OPTION[0]="MsiId"
OPSI_INI_VALUE[0]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
# if the package supports X86 AND X86_64 (setup3264.ins delsub3264.ins uninstall3264.ins) then you have to specify 2 UninstallProg's
##### Installer ##############
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="UninstallProg32"
OPSI_INI_OPTION[0]="UninstallExecutable"
OPSI_INI_VALUE[0]="uninstall.exe"
# OR
OPSI_INI_SECTION[1]="X86_64"
OPSI_INI_OPTION[1]="UninstallExecutable"
OPSI_INI_VALUE[1]="uninstall.exe"
# if the package supports X86 AND X86_64 (setup3264.ins delsub3264.ins uninstall3264.ins) then you have to specify 2 MsiId's or UninstallProg's
##### Msi ######
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="MsiId32"
OPSI_INI_VALUE[0]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
# AND
OPSI_INI_SECTION[1]="X86_64"
OPSI_INI_OPTION[1]="UninstallProg64"
OPSI_INI_OPTION[1]="MsiId64"
OPSI_INI_VALUE[1]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
##### Installer ##############
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="UninstallExecutable32"
OPSI_INI_VALUE[0]="uninstall.exe"
# AND
OPSI_INI_SECTION[1]="X86_64"
OPSI_INI_OPTION[1]="UninstallExecutable64"
OPSI_INI_VALUE[1]="uninstall.exe"