Add new 32bit templates
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3,32 +3,46 @@
|
||||
; 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$ + "\" + $UninstallProg$
|
||||
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
|
||||
Message "Uninstalling " + $ProductId$ + " " + $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " ..."
|
||||
|
||||
if FileExists($IniFile$)
|
||||
Set $UninstallProg$ = GetValueFromInifile($IniFile$,"X86","UninstallProg","XXXXXXXX.exe")
|
||||
Set $UninstallProgramOld$ = $InstallDir$ + "\" + $UninstallProg$
|
||||
Set $UninstallExecutable$ = GetValueFromInifile($IniFile$,"X86","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_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_check_exitcode
|
||||
;set $Reboot$="1"
|
||||
endif
|
||||
|
||||
;comment "Kill Web Browser"
|
||||
;ExecWith_BrowserKill %System%\cscript.exe //b //nologo
|
||||
|
||||
comment "Delete files"
|
||||
Files_uninstall /32Bit
|
||||
|
||||
@@ -38,34 +52,53 @@ Registry_uninstall /32Bit
|
||||
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
|
||||
; maybe better called as
|
||||
; Winbatch_uninstall_old /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
|
||||
; maybe better called as
|
||||
; Winbatch_uninstall /WaitforProcessending "Au_.exe" /Timeoutseconds 10
|
||||
; "$UninstallProgram$" /S
|
||||
;
|
||||
; === Inno Setup ========================================================================================
|
||||
; "$UninstallProgram$" /silent /norestart /SUPPRESSMSGBOXES /nocancel
|
||||
|
||||
|
||||
[Files_uninstall]
|
||||
; Example for recursively deleting the installation directory:
|
||||
;
|
||||
del -sf "$InstallDir$\"
|
||||
; del -sf "$InstallDir$\"
|
||||
|
||||
[Registry_uninstall]
|
||||
; Example of deleting a registry key:
|
||||
@@ -73,6 +106,10 @@ del -sf "$InstallDir$\"
|
||||
; 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
|
||||
@@ -84,6 +121,20 @@ del -sf "$InstallDir$\"
|
||||
; 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
|
||||
@@ -1,5 +1,7 @@
|
||||
[X86]
|
||||
|
||||
[X86_64]
|
||||
|
||||
[COMMON]
|
||||
PN=name
|
||||
VERSION=version
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
; credits: http://www.opsi.org/en/credits/
|
||||
|
||||
[Actions]
|
||||
requiredWinstVersion >= "4.11.2.6"
|
||||
requiredWinstVersion >= "4.11.4.6"
|
||||
ScriptErrorMessages=off
|
||||
|
||||
include_append "%ScriptPath%\browserkill.opsiinc"
|
||||
|
||||
DefVar $UninstallProgram$
|
||||
DefVar $UninstallProgramOld$
|
||||
@@ -22,7 +25,20 @@ DefVar $OLD_VERSION$
|
||||
DefVar $OLD_CREATOR_TAG$
|
||||
DefVar $OLD_RELEASE$
|
||||
|
||||
Set $LogDir$ = "%SystemDrive%\tmp"
|
||||
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:
|
||||
@@ -34,10 +50,19 @@ Set $LogDir$ = "%SystemDrive%\tmp"
|
||||
;
|
||||
@@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
|
||||
; $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"
|
||||
@@ -49,6 +74,12 @@ Set $LicensePool$ = "p_" + $ProductId$
|
||||
|
||||
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
|
||||
|
||||
; Check Minimalen OS Version
|
||||
if not(CompareDotSeparatedNumbers(GetMsVersionInfo, ">=", $CheckOsVersion$))
|
||||
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 "No Space"
|
||||
@@ -57,9 +88,9 @@ else
|
||||
comment "Show product picture"
|
||||
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
|
||||
|
||||
if FileExists("%ScriptPath%\delsub32.ins")
|
||||
if FileExists("%ScriptPath%\delsub32.opsiscript")
|
||||
comment "Start uninstall sub section"
|
||||
Sub "%ScriptPath%\delsub32.ins"
|
||||
Sub "%ScriptPath%\delsub32.opsiscript"
|
||||
endif
|
||||
|
||||
Message "Installing " + $ProductId$ + " "+ $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " ..."
|
||||
@@ -72,17 +103,47 @@ else
|
||||
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_check_exitcode
|
||||
|
||||
comment "Copy files"
|
||||
Files_install /32Bit
|
||||
|
||||
;comment "Kill Web Browser"
|
||||
;ExecWith_BrowserKill %System%\cscript.exe //b //nologo
|
||||
|
||||
comment "Disable Update check"
|
||||
DosInAnIcon_DisableUpdate
|
||||
|
||||
comment "Patch Registry"
|
||||
Registry_install /32Bit
|
||||
|
||||
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]
|
||||
@@ -94,12 +155,12 @@ endif
|
||||
;
|
||||
; === 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
|
||||
; 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=2 REBOOT=ReallySuppress"
|
||||
; "%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"
|
||||
@@ -129,6 +190,10 @@ copy "$IniCfgFile$" "$InstallDir$"
|
||||
; 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
|
||||
@@ -141,7 +206,7 @@ copy "$IniCfgFile$" "$InstallDir$"
|
||||
;
|
||||
; set_link
|
||||
; name: $ProductId$
|
||||
; target: <path to the program>
|
||||
; target: $InstallDir$\$ProgramExecutable$
|
||||
; parameters:
|
||||
; working_dir: $InstallDir$
|
||||
; icon_file:
|
||||
@@ -155,13 +220,55 @@ copy "$IniCfgFile$" "$InstallDir$"
|
||||
;
|
||||
; set_link
|
||||
; name: $ProductId$
|
||||
; target: <path to the program>
|
||||
; target: $InstallDir$\$ProgramExecutable$
|
||||
; 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"
|
||||
@@ -4,7 +4,8 @@
|
||||
; credits: http://www.opsi.org/en/credits/
|
||||
|
||||
[Actions]
|
||||
requiredWinstVersion >= "4.11.2.6"
|
||||
requiredWinstVersion >= "4.11.4.6"
|
||||
ScriptErrorMessages=off
|
||||
|
||||
DefVar $UninstallProgram$
|
||||
DefVar $UninstallProgramOld$
|
||||
@@ -20,7 +21,11 @@ DefVar $OLD_VERSION$
|
||||
DefVar $OLD_CREATOR_TAG$
|
||||
DefVar $OLD_RELEASE$
|
||||
|
||||
Set $LogDir$ = "%SystemDrive%\tmp"
|
||||
DefVar $Reboot$
|
||||
|
||||
DefVar $Property_FileTypeAssociation$
|
||||
|
||||
Set $LogDir$ = "%opsiLogDir%"
|
||||
|
||||
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
|
||||
; and adds the following variables:
|
||||
@@ -47,9 +52,9 @@ ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
|
||||
|
||||
Message "Uninstalling " + $ProductId$ + " ..."
|
||||
|
||||
if FileExists("%ScriptPath%\delsub32.ins")
|
||||
if FileExists("%ScriptPath%\delsub32.opsiscript")
|
||||
comment "Start uninstall sub section"
|
||||
Sub "%ScriptPath%\delsub32.ins"
|
||||
Sub "%ScriptPath%\delsub32.opsiscript"
|
||||
endif
|
||||
|
||||
if $LicenseRequired$ = "true"
|
||||
@@ -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: setup32.ins
|
||||
uninstallScript: uninstall32.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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user