From 3620e37e454b9a10ef2665d4f03ddfcc4c8e3dd6 Mon Sep 17 00:00:00 2001 From: yuriy Date: Wed, 2 Aug 2023 22:08:07 -0400 Subject: [PATCH] Updated chrome function to check for chrome filepath variable before setting it based on hardcoded path --- Chrome-Functions.ahk | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Chrome-Functions.ahk b/Chrome-Functions.ahk index 5b1c26e..6e4f340 100644 --- a/Chrome-Functions.ahk +++ b/Chrome-Functions.ahk @@ -23,20 +23,23 @@ GetChromeFilepath(){ ; ChromeFilepath is global variable ; Establish Variable with Filepath to be used throughout the script - ChromePortableFilepath = %A_ScriptDir%\Lib\chrome-win64\chrome.exe + if(ChromeFilepath = ""){ - if(FileExist(ChromePortableFilepath)){ - ChromeFilepath := ChromePortableFilepath + ChromePortableFilepath = %A_ScriptDir%\Lib\chrome-win64\chrome.exe - Message = Using Chromium Portable for Upload - SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") - } - else { - if(FileExist("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")) - ChromeFilepath = C:\Program Files (x86)\Google\Chrome\Application\chrome.exe + if(FileExist(ChromePortableFilepath)){ + ChromeFilepath := ChromePortableFilepath - if(FileExist("C:\Program Files\Google\Chrome\Application\chrome.exe")) - ChromeFilepath = C:\Program Files\Google\Chrome\Application\chrome.exe + Message = Using Chromium Portable for Upload + SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") + } + else { + if(FileExist("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")) + ChromeFilepath = C:\Program Files (x86)\Google\Chrome\Application\chrome.exe + + if(FileExist("C:\Program Files\Google\Chrome\Application\chrome.exe")) + ChromeFilepath = C:\Program Files\Google\Chrome\Application\chrome.exe + } } }