147 lines
4.3 KiB
TeX
147 lines
4.3 KiB
TeX
; 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/credits/
|
|
|
|
[Actions]
|
|
requiredWinstVersion >= "4.10.8.6"
|
|
|
|
|
|
DefVar $msifile$
|
|
DefVar $officescan.fqdn$
|
|
DEfVar $officescan.sharename$
|
|
DefVar $domainuser.loginname$
|
|
DEfVar $domainuser.password$
|
|
DefVar $connectionstr$
|
|
DefVar $UninstallProgram$
|
|
DefVar $LogDir$
|
|
DefVar $ProductId$
|
|
DefVar $MinimumSpace$
|
|
DefVar $InstallDir$
|
|
DefVar $ExitCode$
|
|
DefVar $LicenseRequired$
|
|
DefVar $LicenseKey$
|
|
DefVar $LicensePool$
|
|
|
|
Set $LogDir$ = "%SystemDrive%\tmp"
|
|
|
|
Set $officescan.fqdn$ = GetProductProperty ("officescan.fqdn","values")
|
|
Set $officescan.sharename$ = GetProductProperty ("officescan.sharename","values")
|
|
Set $domainuser.loginname$ = GetProductProperty ("domainuser.loginname","values")
|
|
Set $domainuser.password$ = GetProductProperty ("domainuser.password","values")
|
|
Set $msifile$ = "%SystemDrive%\tmp\agentWin32.msi"
|
|
|
|
Set $connectionstr$ = "\\" + $officescan.fqdn$ + "\" + $officescan.sharename$ + " /user:" + $domainuser.loginname$ + " " + $domainuser.password$
|
|
|
|
|
|
; 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 -
|
|
; ----------------------------------------------------------------
|
|
;$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 $ProductId$ = "trendmicro.wfbsstd7"
|
|
Set $MinimumSpace$ = "1 MB"
|
|
; the path were we find the product after the installation
|
|
Set $InstallDir$ = "%ProgramFiles32Dir%\OpenVPN"
|
|
Set $LicenseRequired$ = "false"
|
|
Set $LicensePool$ = "p_" + $ProductId$
|
|
; ----------------------------------------------------------------
|
|
|
|
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" $ProductId$
|
|
|
|
Message "Installing " + $ProductId$ + " ..."
|
|
|
|
if $LicenseRequired$ = "true"
|
|
comment "Licensing required, reserve license and get license key"
|
|
Sub_get_licensekey
|
|
endif
|
|
|
|
|
|
DosInAnIcon_delmsi
|
|
DosInAnIcon_delvcredist
|
|
|
|
comment "Start setup program"
|
|
DosInAnIcon_mount
|
|
|
|
comment "Copy files"
|
|
Files_install /32Bit
|
|
|
|
if not (FileExists($msifile$))
|
|
isFatalError
|
|
Endif
|
|
|
|
comment "Extracting VC++ 2005 Lib"
|
|
Winbatch_install_extract
|
|
Sub_check_exitcode
|
|
|
|
if not (FileExists($LogDir$+"\vcredist.msi"))
|
|
isFatalError
|
|
Endif
|
|
|
|
comment "Installing VC++ 2005 Lib"
|
|
Winbatch_install_vcredist
|
|
Sub_check_exitcode
|
|
|
|
comment "Installing TM Worry Free"
|
|
Winbatch_install_wf
|
|
Sub_check_exitcode
|
|
|
|
comment "Cleanup Files"
|
|
DosInAnIcon_delvcredist
|
|
DosInAnIcon_delmsi
|
|
endif
|
|
|
|
[DosInAnIcon_mount]
|
|
net use f: /delete /y
|
|
net use f: $connectionstr$
|
|
|
|
[DosInAnIcon_delmsi]
|
|
del $msifile$
|
|
|
|
[DosInAnIcon_delvcredist]
|
|
del $LogDir$\vcredist.msi
|
|
del $LogDir$\vcredis1.cab
|
|
|
|
[Files_install]
|
|
copy "F:\Download\agentWin32.msi" $LogDir$
|
|
|
|
[Winbatch_install_extract]
|
|
$vcredist86Exe$ /Q /C /T:$LogDir$
|
|
|
|
[Winbatch_install_vcredist]
|
|
$LogDir$\vcredist.msi /quiet
|
|
|
|
[Winbatch_install_wf]
|
|
$msifile$ /quiet
|
|
|
|
|
|
[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$
|
|
isFatalError
|
|
endif
|