2012-06-18 21:38:51 +02:00
; 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"
2012-06-20 14:30:09 +02:00
2012-06-21 13:02:37 +02:00
DefVar $msifile$
2015-04-27 13:59:52 +02:00
DefVar $msifileX64$
2012-06-20 14:30:09 +02:00
DefVar $officescan.fqdn$
DEfVar $officescan.sharename$
DefVar $domainuser.loginname$
DEfVar $domainuser.password$
DefVar $connectionstr$
2012-06-18 21:38:51 +02:00
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
2015-04-27 13:59:52 +02:00
DefVar $INST_SystemType$
DefVar $INST_architecture$
2012-06-18 21:38:51 +02:00
2015-04-27 13:59:52 +02:00
Set $INST_SystemType$ = GetSystemType
Set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
2012-06-18 21:38:51 +02:00
2015-04-27 13:59:52 +02:00
Set $LogDir$ = "%SystemDrive%\tmp"
2012-06-20 14:30:09 +02:00
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")
2012-06-21 13:02:37 +02:00
Set $msifile$ = "%SystemDrive%\tmp\agentWin32.msi"
2015-04-27 13:59:52 +02:00
Set $msifileX64$ = "%SystemDrive%\tmp\agentX64.msi"
2012-06-20 14:30:09 +02:00
Set $connectionstr$ = "\\" + $officescan.fqdn$ + "\" + $officescan.sharename$ + " /user:" + $domainuser.loginname$ + " " + $domainuser.password$
2012-06-18 21:38:51 +02:00
2012-06-20 21:16:18 +02:00
2012-06-18 21:38:51 +02:00
; 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
;
2012-06-28 15:34:22 +02:00
@@BUILDER_VARIABLES@@
2012-06-18 21:38:51 +02:00
; ----------------------------------------------------------------
; - 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
2015-04-27 13:59:52 +02:00
endif
2012-06-28 15:34:22 +02:00
DosInAnIcon_delmsi
DosInAnIcon_delvcredist
2012-06-20 21:16:18 +02:00
2012-06-18 21:38:51 +02:00
comment "Start setup program"
2012-06-28 15:34:22 +02:00
DosInAnIcon_mount
2012-06-20 21:16:18 +02:00
2015-04-27 13:59:52 +02:00
if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
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
DosInAnIcon_delvcredist
comment "Extracting VC++ 2005 Lib"
Winbatch_install_extract_64
Sub_check_exitcode
if not (FileExists($LogDir$+"\vcredist.msi"))
isFatalError
Endif
comment "Installing VC++ 2005 Lib"
Winbatch_install_vcredist
Sub_check_exitcode
2015-05-11 11:58:56 +02:00
Files_install_64
if not (FileExists($msifileX64$))
isFatalError
Endif
2015-04-27 13:59:52 +02:00
comment "Installing TM Worry Free X64"
Winbatch_install_wf_x64
Sub_check_exitcode
comment "Cleanup Files"
DosInAnIcon_delvcredist
DosInAnIcon_delmsi_64
endif
if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
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 "Copy files"
Files_install_32 /32Bit
if not (FileExists($msifile$))
isFatalError
Endif
comment "Installing TM Worry Free"
Winbatch_install_wf
Sub_check_exitcode
comment "Cleanup Files"
DosInAnIcon_delvcredist
DosInAnIcon_delmsi_32
endif
2012-06-18 21:38:51 +02:00
endif
2012-06-28 15:34:22 +02:00
[DosInAnIcon_mount]
2012-06-20 21:16:18 +02:00
net use f: /delete /y
2012-06-20 14:30:09 +02:00
net use f: $connectionstr$
2012-06-20 21:16:18 +02:00
2015-04-27 13:59:52 +02:00
[DosInAnIcon_delmsi_32]
2012-06-21 13:02:37 +02:00
del $msifile$
2015-04-27 13:59:52 +02:00
[DosInAnIcon_delmsi_64]
del $msifileX64$
2012-06-28 15:34:22 +02:00
[DosInAnIcon_delvcredist]
del $LogDir$\vcredist.msi
del $LogDir$\vcredis1.cab
2015-04-27 13:59:52 +02:00
[Files_install_32]
2012-06-28 15:34:22 +02:00
copy "F:\Download\agentWin32.msi" $LogDir$
2015-04-27 13:59:52 +02:00
[Files_install_64]
copy "F:\Download\agentX64.msi" $LogDir$
2012-06-28 15:34:22 +02:00
[Winbatch_install_extract]
$vcredist86Exe$ /Q /C /T:$LogDir$
2015-04-27 13:59:52 +02:00
[Winbatch_install_extract_64]
$vcredist64Exe$ /Q /C /T:$LogDir$
2012-06-28 15:34:22 +02:00
[Winbatch_install_vcredist]
$LogDir$\vcredist.msi /quiet
[Winbatch_install_wf]
$msifile$ /quiet
2012-06-18 21:38:51 +02:00
2015-04-27 13:59:52 +02:00
[Winbatch_install_wf_x64]
$msifileX64$ /quiet
2012-06-18 21:38:51 +02:00
2012-06-20 21:16:18 +02:00
[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