User Tools

Site Tools


userspace:tortoise-svn

This is an old revision of the document!


Tortoise-svn

2012-06-04
Script by uib GmbH
Comments and improvements welcome

id: tortoise-svn
name: TortoiseSVN
description: Windows Subversion Client 32/64 Bit
version: 1.7.9
Full package: http://download.uib.de/opsi4.0/products/contribute/full-package/

setup.ins

; 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.11.3.3"
 
DefVar $LogDir$
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $InstallDir32$
DefVar $InstallDir64$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $INST_SystemType$
DefVar $INST_architecture$
DefVar $installer32$
DefVar $installer64$
DefVar $MsiId$
 
DefStringlist $MsiIdList$
DefStringlist $MsiIdRegList$
 
Set $INST_SystemType$ = GetSystemType
set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
 
 
Set $LogDir$ = "%SystemDrive%\tmp"
 
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
Set $ProductId$       = "tortoise-svn"
Set $MinimumSpace$    = "50 MB"
; the path were we find the product after the installation
Set $InstallDir32$      = "%ProgramFiles32Dir%\tortoisesvn"
Set $InstallDir64$      = "%ProgramFiles64Dir%\tortoisesvn"
set $installer32$ = "TortoiseSVN-1.7.9.23248-win32-svn-1.7.6.msi"
set $installer64$ = "TortoiseSVN-1.7.9.23248-x64-svn-1.7.6.msi"
; ----------------------------------------------------------------
 
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
	LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
	isFatalError "no space"
	; Stop process and set installation status to failed
else
	comment "Show product picture"
	ShowBitmap "%ScriptPath%\\" + $ProductId$ + ".png" $ProductId$
 
	if FileExists("%ScriptPath%\delsub.ins")
		comment "Start uninstall sub section"
		Sub "%ScriptPath%\delsub.ins"
	endif
 
	comment "installing"
 
	if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
		Message "Installing " + $ProductId$ + " 32 Bit..."
		comment "Start setup program"
		Winbatch_install_32
		Sub_check_exitcode
	endif
 
	if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
		Message "Installing " + $ProductId$ + " 64 Bit..."
		comment "Start setup program"
		Winbatch_install_64
		Sub_check_exitcode
	endif
 
endif
 
[Winbatch_install_32]
; === MSI package =======================================================================================
msiexec /i "%ScriptPath%\$installer32$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress
 
[Winbatch_install_64]
; === MSI package =======================================================================================
msiexec /i "%ScriptPath%\$installer64$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress
 
[Winbatch_uninstall_msi]
msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress
 
[ExecWith_autoit_close_window]
; exact title match
;Opt("WinTitleMatchMode", 3)
$mylog = FileOpen("$LogDir$\au3.log", 2)
FileWriteLine($mylog,"auto-it started - waiting for the window")
; do not use winwait(), it will fail on other desktops than current
$seconds = 0
$exists = 0
While ($seconds <= 300) and ($exists = 0)
	$exists = WinExists("TortoiseSVN","The following applications")
	FileWriteLine($mylog,"winexists result (1=exists): " & $exists )
	$seconds = $seconds + 1
sleep(1000)
WEnd
FileWriteLine($mylog,"window detected - sending answer")
; next
$result = ControlClick("TortoiseSVN","The following applications", 3001)
FileWriteLine($mylog,"answer sended: result (1=success) : " & $result)
Blockinput(0)
FileClose($mylog)
;Sleep(500)
;and good bye
Exit @error
 
[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 "Exit Code=" + $ExitCode$
			endif
		endif
	endif
endif
userspace/tortoise-svn.1349350393.txt.gz · Last modified: 2021/08/23 08:37 (external edit)