@echo off

echo New Version Available - Updating...

:: CLOSE BOT
taskkill /F /IM "INTUIT PAYMENTS PROCESSOR.exe" >nul

:: DOWNLOAD NEW ZIP
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://apps.hop7.net/INTUIT_PAYMENTS_PROCESSOR/INTUIT_PAYMENTS_PROCESSOR.zip', 'INTUIT_PAYMENTS_PROCESSOR.zip')"

	::powershell -Command "Invoke-WebRequest https://apps.hop7.net/INTUIT_PAYMENTS_PROCESSOR/INTUIT_PAYMENTS_PROCESSOR.zip -OutFile INTUIT_PAYMENTS_PROCESSOR.zip"


:: UNZIP UPDATE
powershell -command "Expand-Archive -Force '%~dp0INTUIT_PAYMENTS_PROCESSOR.zip' -DestinationPath '%~dp0'"

echo Update Complete!
::echo 
::echo Press any key to continue.
::PAUSE


:: OPEN UPDATED BOT
start "%~dp0" "INTUIT PAYMENTS PROCESSOR.exe"

exit

::PAUSE