User Tools

Site Tools


userspace:tortoise-svn

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
userspace:tortoise-svn [2012/10/04 11:33]
bhubal
userspace:tortoise-svn [2021/08/23 08:37] (current)
Line 150: Line 150:
  endif  endif
 endif endif
 +
 +</code>
 +
 +==== delsub.ins ====
 +<code winst>
 +
 +
 +; 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/credits/
 +
 +comment "collect known MSI IDs of the product"
 +set $MsiIdList$ = createStringList('{DE9CF741-20F7-488B-8B85-9D0F86FA51B4}')
 +set $MsiIdList$ = addtolist($MsiIdList$,'{6E8AA68E-AE56-48EE-ACE6-05647EA46F6A}')
 +set $MsiIdList$ = addtolist($MsiIdList$,'{4371D69B-FB6A-4A61-8477-C1B919FB2311}')
 +set $MsiIdList$ = addtolist($MsiIdList$,'{5D762D74-E92F-4E95-9255-D85312617E4D}')
 +
 +comment "collect Installed MSI IDs"
 +set $MsiIdRegList$ = getRegistryKeyList32("HKLM\Software\Microsoft\Windows\Currentversion\uninstall")
 +set $MsiIdRegList$ = addListToList($MsiIdRegList$, getRegistryKeyList64("HKLM\Software\Microsoft\Windows\Currentversion\uninstall"))
 +
 +comment "uninstall all we find..."
 +for %s% in $MsiIdList$ do sub_uninstall
 +
 +[sub_uninstall]
 +if not ("" = takeFirstStringContaining($MsiIdRegList$,"%s%"))
 + comment "MSI id %s% found in registry, starting msiexec to uninstall"
 + if not ("" = takeFirstStringContaining(GetProcessList,"explorer.exe"))
 + comment "explorer will be killed - so we have to reboot"
 + Exitwindows /Reboot
 + endif
 + set $MsiId$ = "%s%"
 + ExecWith_autoit_close_window "%scriptpath%\autoit3.exe" winst /LetThemGo
 + Winbatch_uninstall_msi
 + killtask "autoit3.exe"
 + sub_check_exitcode
 + includelog $LogDir$+"\au3.log" "50"
 +endif
 +
 +[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
 +
 +</code>
 +
 +
 +==== uninstall.ins ====
 +<code winst>
 +; 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/credits/
 +
 +[Actions]
 +requiredWinstVersion >= "4.11.3.3"
 +
 +DefVar $LogDir$
 +DefVar $ExitCode$
 +DefVar $ProductId$
 +DefVar $InstallDir32$
 +DefVar $InstallDir64$
 +DefVar $LicenseRequired$
 +DefVar $LicensePool$
 +DefVar $INST_SystemType$
 +DefVar $INST_architecture$
 +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 $InstallDir32$      = "%ProgramFiles32Dir%\tortoisesvn"
 +Set $InstallDir64$      = "%ProgramFiles64Dir%\tortoisesvn"
 +; ----------------------------------------------------------------
 +
 +
 +comment "Show product picture"
 +ShowBitmap "%ScriptPath%\\" + $ProductId$ + ".png" $ProductId$
 +
 +Message "Uninstalling " + $ProductId$ + " ..."
 +
 +if FileExists("%ScriptPath%\delsub.ins")
 + comment "Start uninstall sub section"
 + Sub "%ScriptPath%\delsub.ins"
 +endif
 +
 +[Winbatch_uninstall_msi]
 +msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress
 +
 </code> </code>
userspace/tortoise-svn.1349350393.txt.gz ยท Last modified: 2021/08/23 08:37 (external edit)