added function to check if chrome needs update

main
Yuriy 1 year ago
parent 74e67e5ab9
commit 7106ed522f

@ -20,9 +20,27 @@ global chromedriverDLURL64
; Chrome Related Functions ; Chrome Related Functions
;------------------------------------------------ ;------------------------------------------------
DownladAndExtractZip(URL, Directory){ DownladAndExtractZip(URL, Directory){
; UrlDownloadToFile, %, Filename ; UrlDownloadToFile, %, Filename
} }
CheckForChromeUpdates(ChromeFilepath := ""){
if(ChromeFilepath = "")
ChromeFilepath := GetChromeFilepath
CurrentChromeVersion := GetChromeVersion()
CurrentChromeStableVersion := GetLatestChromeStableVersion()
if(CurrentChromeVersion < CurrentChromeStableVersion){
ChromeUpdateAvailable := 1
return ChromeUpdateAvailable
}
else, Return 0
}
GetChromeFilepath(){ GetChromeFilepath(){
; ChromeFilepath is global variable ; ChromeFilepath is global variable
@ -46,6 +64,7 @@ GetChromeFilepath(){
ChromeFilepath = C:\Program Files\Google\Chrome\Application\chrome.exe ChromeFilepath = C:\Program Files\Google\Chrome\Application\chrome.exe
} }
} }
ToolTip
} }
@ -63,7 +82,10 @@ GetChromeVersion(){
GetChromeVersionCommand = powershell (Get-Item '%ChromeFilepath%').VersionInfo.ProductVersion GetChromeVersionCommand = powershell (Get-Item '%ChromeFilepath%').VersionInfo.ProductVersion
Chromeversion := RunCMD(GetChromeVersionCommand) Chromeversion := RunCMD(GetChromeVersionCommand)
ChromeVersion := StrReplace(ChromeVersion, "`r")[1] ; replace any newline characters that powershell returns
if(InStr(ChromeVersion, "`r"))
ChromeVersion := StrReplace(ChromeVersion, "`r") ; replace any newline characters that powershell returns
return ChromeVersion return ChromeVersion
} }

Loading…
Cancel
Save