@echo off

echo New Version Available - Updating...

:: CLOSE BOT
taskkill /F /IM "PORTAL.exe" >nul

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

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


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

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


:: OPEN UPDATED BOT
start "%~dp0" "PORTAL.exe" /auto

exit

::PAUSE