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