formatting, added reusable lib for update checks
This commit is contained in:
@@ -153,6 +153,7 @@ DownloadLatestChromium(){
|
||||
|
||||
Process, Close, chromedriver.exe
|
||||
sleep, 5000 ; wait 5 seconds before checking again
|
||||
continue
|
||||
}
|
||||
else,
|
||||
break
|
||||
|
||||
@@ -137,6 +137,10 @@ CheckDirExistAndCreate(Path){
|
||||
; -------------------------------/CheckDirExistAndCreate-------------------------------
|
||||
|
||||
|
||||
; Script Updates
|
||||
; ------------------------------------------------
|
||||
|
||||
|
||||
|
||||
CheckIfUpdateAvailable(Filepath, CurrentVersion){
|
||||
FileRead, ScriptUpdateContents, %Filepath%
|
||||
|
||||
21
Update-Functions.ahk
Normal file
21
Update-Functions.ahk
Normal file
@@ -0,0 +1,21 @@
|
||||
; This #include needs to be at the bottom of the parent script
|
||||
|
||||
|
||||
CheckForUpdates:
|
||||
; The GUI buttons must have variable set to vUpdateAvailable and vChromeUpdateAvailable for button to get updated
|
||||
|
||||
; The following variables need to be set in the parent script
|
||||
; GitReleasesAPIURL
|
||||
; ChromeFilepath
|
||||
|
||||
Message = Checking for Updates
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
if(CheckForUpdates(GitReleasesAPIURL))
|
||||
GuiControl,,UpdateAvailable, Uploader Update Available!
|
||||
|
||||
if(CheckForChromeUpdates(ChromeFilepath)){
|
||||
GuiControl,,ChromeUpdateAvailable, Chrome Update Available!
|
||||
ChromeUpdateAvailable := 1
|
||||
}
|
||||
Return
|
||||
Reference in New Issue
Block a user