1
0
mirror of https://github.com/heebijeebi/WinTango-Patcher.git synced 2024-06-22 05:21:56 +02:00

Adding Mirror compatibility to Updater

This commit is contained in:
heebijeebi
2016-12-13 17:18:39 +01:00
parent 97b90002be
commit 5235074d14
4 changed files with 7 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
[Updater]
MainApp=16.01.07
URL=https://github.com/heebijeebi/WinTango-Patcher/releases/download/v16.01.07/WinTango-Patcher-16.01.07-offline.exe
URL=Zippyshare
URL2=https://github.com/heebijeebi/WinTango-Patcher/releases/download/v16.01.07/WinTango-Patcher-16.01.07-offline.exe

View File

@@ -32,6 +32,7 @@ Func _CheckForUpdate()
EndIf
$sVerLatest[1] = IniRead($sDest, "Updater", "URL", "") ;URL for Installer
$sVerLatest[2] = IniRead($sDest, "Updater", "URL2", "") ;URL for Installer (Mirror)
FileDelete($sDest) ;Delete the Infofile

View File

@@ -107,8 +107,10 @@ While 1
GUICtrlSetState($btnUpdate, $GUI_HIDE)
;Download Latest Version...
$sUrl = $AppVersionLatest[1]
$sUrlMirror = $AppVersionLatest[2]
$sDest = @TempDir & "\" & StringReplace($AppName, " ", "-") & "-LATEST.exe"
_DownloadLatestVersion($sUrl, $sDest)
If not FileExists($sDest) Then _DownloadLatestVersion($sUrlMirror, $sDest) ;retry with mirror
;...and install it
_RunDownload($sDest)
Exit

View File

@@ -65,8 +65,10 @@ EndIf
GUICtrlSetData($lblCurrent, $string_msgDownloading)
$sUrl = $AppVersionLatest[1]
$sUrlMirror = $AppVersionLatest[2]
$sDest = @TempDir & "\" & StringReplace($AppName, " ", "-") & "-LATEST.exe"
_DownloadLatestVersion($sUrl, $sDest)
If not FileExists($sDest) Then _DownloadLatestVersion($sUrlMirror, $sDest) ;retry with mirror
GUICtrlSetData($lblOverall, $string_msgDownloadDone)
Sleep(2000)