From 81355e0357cf789fd74a2f7cffcc3bfa55d43a02 Mon Sep 17 00:00:00 2001 From: chase Date: Sun, 28 Aug 2022 11:29:08 -0500 Subject: [PATCH] Offline Install Option --- .github/release.sh | 1 + .github/workflows/release.yml | 1 + .gitignore | 2 ++ Redist-Installer.bat | 18 +++++++++++++++++- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/release.sh b/.github/release.sh index 824b1cc..7555a81 100644 --- a/.github/release.sh +++ b/.github/release.sh @@ -7,3 +7,4 @@ zip -r redists.zip * mv redists.zip ../ cd .. rm -rf redists/ +zip -r offlineInstall.zip 7za.exe 7za.dll redists.zip Redist-Installer.bat diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3c4b54d..55a73cd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,3 +24,4 @@ jobs: 7za.dll 7za.exe redists.zip + offlineInstall.zip diff --git a/.gitignore b/.gitignore index 30f65c7..d217aa9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ # Misc *.bak .DS_Store +redists.zip +offlineInstall.zip diff --git a/Redist-Installer.bat b/Redist-Installer.bat index 08fbde7..128d658 100644 --- a/Redist-Installer.bat +++ b/Redist-Installer.bat @@ -9,8 +9,22 @@ cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && title Redist Installer md %temp%\Redist-Installer >nul 2>&1 -cd %temp%\Redist-Installer +if exist "7za.dll" ( + if exist "7za.exe" ( + if exist "redists.zip" ( + move /Y 7za.dll %temp%\Redist-Installer >nul + move /Y 7za.exe %temp%\Redist-Installer >nul + move /Y redists.zip %temp%\Redist-Installer >nul + goto offlineInstall + ) + ) +) else ( + goto onlineInstall +) + +:onlineInstall +cd %temp%\Redist-Installer echo Downloading 1/3... powershell -Command "(New-Object Net.WebClient).DownloadFile('https://github.com/chxseh/Redist-Installer/releases/download/latest/7za.dll', '7za.dll')" echo Downloading 2/3... @@ -18,6 +32,8 @@ powershell -Command "(New-Object Net.WebClient).DownloadFile('https://github.com echo Downloading 3/3... powershell -Command "(New-Object Net.WebClient).DownloadFile('https://github.com/chxseh/Redist-Installer/releases/download/latest/redists.zip', 'redists.zip')" +:offlineInstall +cd %temp%\Redist-Installer :: Extract Redists start /wait /min 7za.exe e redists.zip -y