From e830f8e342a1376b1c221c76c17558733edea728 Mon Sep 17 00:00:00 2001 From: JanGamesHD <64363088+JanGamesHD@users.noreply.github.com> Date: Sat, 26 Aug 2023 02:00:59 +0200 Subject: [PATCH] Update Porti.bat --- Porti.bat | 99 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 85 insertions(+), 14 deletions(-) diff --git a/Porti.bat b/Porti.bat index 92d602e..aa2b10d 100644 --- a/Porti.bat +++ b/Porti.bat @@ -15,6 +15,7 @@ if %bananamode%==0 if exist wget.exe set portiworkdir=%cd% if %bananamode%==0 if exist Porti\wget.exe set portiworkdir=%cd%\Porti if %bananamode%==1 if exist wget.exe set portiworkdir=%cd% if %bananamode%==1 if exist Porti\wget.exe set portiworkdir=%cd%Porti +if %bananamode%==1 set cd=%cd:\=% if %bananamode%==1 set curcd=%cd::\=:% if %bananamode%==1 set acd=%cd::\=:% echo bananamode: %bananamode% @@ -43,13 +44,17 @@ cls echo Downloading WGET from https://eternallybored.org/misc/wget/1.19.4/32/wget.exe using Powershell echo Note: Since Powershell is showing the progress bar, this download might take longer. powershell Invoke-WebRequest https://eternallybored.org/misc/wget/1.19.4/32/wget.exe -OutFile %cd%\Porti\wget.exe +:recheckhashwget echo Generating MD5 Hash... certutil -hashfile Porti\wget.exe MD5 | findstr /V ":" >Porti\wgethash.sys +set /p wgethash=Porti\wgethash.sys echo Writing Original Hash to file... echo 3dadb6e2ece9c4b3e1e322e617658b60>Porti\wgethash.org fc Porti\wgethash.sys Porti\wgethash.org if %errorlevel%==0 goto everythingfine echo MD5-Hash verification failed! +if not defined didbitsdownload goto askdownloader set /p remotehash=Porti\unziplocalhash.sys +set /p unziphash=Porti\updatetimer.sys +if not defined dontcheck if not exist Porti\TauserUpdater.bat goto missingfiles +if not defined dontcheck if not exist Porti\Store.bat goto missingfiles +if not defined dontcheck if not exist Porti\Store_loader.bat goto missingfiles +if not defined dontcheck if not exist Porti\Updater.bat goto missingfiles :menu color e0 cls @@ -109,6 +133,7 @@ if not exist Porti\portitext.sys goto getportitext type Porti\portitext.sys type NUL type NUL +echo. title Porti: Main Menu echo 1) My Applications echo 2) Tauser Store (Application Store) @@ -223,13 +248,15 @@ goto menu title Porti: Settings cls echo Welcome to settings -echo 1) Check for updates -echo 2) Reset -echo 3) go back ... +echo 1) Check for Porti-Updates +echo 2) Check for Tauser-Application Updates +echo 3) Reset +echo 4) go back ... set /p opt=Opt: if %opt%==1 goto check4updates -if %opt%==2 goto reset -if %opt%==3 goto menu +if %opt%==2 goto tauserappupdates +if %opt%==3 goto reset +if %opt%==4 goto menu goto settings :reset @@ -350,3 +377,47 @@ goto reload cd \Porti call Porti.bat exit + +:unziphashfailed +echo Error: Unable to verify hash from unzip.exe +echo Got: %unziphash% +echo Expected: %comp% +echo Do you want to proceed anyway? (y/n) +echo Note: n will re-download unzip.exe and reperforms the Hash-Check +set /p opt=Opt: +if %opt%==y goto setupcompt +if %opt%==n goto unzipdownload +goto unziphashfailed + + +:askdownloader +cls +echo Unable to download WGET using Powershell! +echo trying to download with bitsadmin (this will take ages btw) +timeout 2 >NUL +bitsadmin /transfer "WGET-Download" /PRIORITY HIGH "https://eternallybored.org/misc/wget/1.19.4/32/wget.exe" "%cd%\Porti\wget.exe" +set didbitsdownload=1 +goto recheckhashwget + +:tauserappupdates +echo CD: %cd% +start Porti\TauserUpdater.bat +goto menu + +:missingfiles +cls +echo WARNING: Some Porti Files are missing. +echo Do you want to restart Setup to re-download them? +echo Your data will not be deleted. +echo 1) Setup +echo 2) Continue anyway +echo 3) Exit +set /p opt=Opt: +if %opt%==1 goto setup +if %opt%==2 goto setnochecksession +if %opt%==3 exit +goto missingfiles + +:setnochecksession +set dontcheck=1 +goto menu