From 3485a5a9a3a99acbc29be15f1f6bc2b7fa5395d8 Mon Sep 17 00:00:00 2001 From: Calyx Hikari Date: Sun, 16 Nov 2025 00:08:27 +0800 Subject: [PATCH] Add automated generator --- .github/workflows/build.yml | 39 +++++++++++++++++ generate.sh | 2 + generate_all.sh | 87 +++++++++++++++++++++++++++++++++++++ install_AllOS.nsi | 2 +- install_AtLeastWin10.nsi | 2 +- install_AtLeastWin7.nsi | 2 +- 6 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 generate_all.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..3eebc1b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,39 @@ +name: Run generate.sh + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-24.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y aria2 nsis + + - name: Run generate.sh + run: | + chmod +x ./generate_all.sh + ./generate_all.sh + + - name: Get build date + id: date + run: echo "date=$(date +'%Y.%m.%d')" >> $GITHUB_OUTPUT + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: v${{ steps.date.outputs.date }} + name: Release ${{ steps.date.outputs.date }} + files: MSVC_Offline_Setup_*.exe + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/generate.sh b/generate.sh index 45ca31b..d0af1b9 100644 --- a/generate.sh +++ b/generate.sh @@ -108,5 +108,7 @@ installerFileName=$(ls *.exe) mv *.exe ../ popd +rm -rf msvc_offline + echo -e "Installer generated. " echo -e "Filename: ${installerFileName}" \ No newline at end of file diff --git a/generate_all.sh b/generate_all.sh new file mode 100644 index 0000000..7edb18e --- /dev/null +++ b/generate_all.sh @@ -0,0 +1,87 @@ +#!/bin/bash +shopt -s nocasematch + +cat << EOF > downloadLink.txt +https://get.msvc.win/favicon.ico + out=favicon.ico + +https://download.microsoft.com/download/8/b/4/8b42259f-5d70-43f4-ac2e-4b208fd8d66a/vcredist_x86.exe + out=vcredist_2005_x86.exe + +https://download.microsoft.com/download/8/b/4/8b42259f-5d70-43f4-ac2e-4b208fd8d66a/vcredist_x64.exe + out=vcredist_2005_x64.exe + +https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe + out=vcredist_2008_x86.exe + +https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x64.exe + out=vcredist_2008_x64.exe + +https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x86.exe + out=vcredist_2010_x86.exe + +https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x64.exe + out=vcredist_2010_x64.exe + +https://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x86.exe + out=vcredist_2012_x86.exe + +https://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe + out=vcredist_2012_x64.exe + +https://aka.ms/highdpimfc2013x86enu + out=vcredist_2013_x86.exe + +https://aka.ms/highdpimfc2013x64enu + out=vcredist_2013_x64.exe + +https://download.visualstudio.microsoft.com/download/pr/566435ac-4e1c-434b-b93f-aecc71e8cffc/0D59EC7FDBF05DE813736BF875CEA5C894FFF4769F60E32E87BD48406BBF0A3A/VC_redist.x86.exe + out=vcredist_v14_nt52_x86.exe + +https://download.visualstudio.microsoft.com/download/pr/566435ac-4e1c-434b-b93f-aecc71e8cffc/B75590149FA14B37997C35724BC93776F67E08BFF9BD5A69FACBF41B3846D084/VC_redist.x64.exe + out=vcredist_v14_nt52_x64.exe + +https://download.visualstudio.microsoft.com/download/pr/ed95ef9e-da02-4735-9064-bd1f7f69b6ed/CF92A10C62FFAB83B4A2168F5F9A05E5588023890B5C0CC7BA89ED71DA527B0F/VC_redist.x86.exe + out=vcredist_v14_nt60_x86.exe + +https://download.visualstudio.microsoft.com/download/pr/ed95ef9e-da02-4735-9064-bd1f7f69b6ed/CE6593A1520591E7DEA2B93FD03116E3FC3B3821A0525322B0A430FAA6B3C0B4/VC_redist.x64.exe + out=vcredist_v14_nt60_x64.exe + +https://aka.ms/vs/17/release/vc_redist.x86.exe + out=vcredist_v14_nt63_x86.exe + +https://aka.ms/vs/17/release/vc_redist.x64.exe + out=vcredist_v14_nt63_x64.exe + +https://aka.ms/vc14/vc_redist.x86.exe + out=vcredist_v14_latest_x86.exe + +https://aka.ms/vc14/vc_redist.x64.exe + out=vcredist_v14_latest_x64.exe + +https://get.msvc.win/install_AllOS.nsi + out=installer1.nsi + +https://get.msvc.win/install_AtLeastWin7.nsi + out=installer2.nsi + +https://get.msvc.win/install_AtLeastWin10.nsi + out=installer3.nsi +EOF +fi + +mkdir msvc_offline +aria2c --dir=msvc_offline --allow-overwrite=true --retry-wait=5 --max-connection-per-server=8 --split=8 --min-split-size=1M -i downloadLink.txt + +pushd msvc_offline +makensis installer1.nsi +makensis installer2.nsi +makensis installer3.nsi +rm vcredist*.exe +installerFileName=$(ls *.exe) +mv *.exe ../ +popd + +rm -rf msvc_offline + +echo -e "All installer files are generated at current directory. " \ No newline at end of file diff --git a/install_AllOS.nsi b/install_AllOS.nsi index c7fa612..d64fba6 100644 --- a/install_AllOS.nsi +++ b/install_AllOS.nsi @@ -24,8 +24,8 @@ VIAddVersionKey /LANG=0x0804 "FileDescription" "MSVC 运行时离线安装程序 VIAddVersionKey /LANG=0x0804 "FileVersion" "${BUILD_YEAR}.${BUILD_MONTH}.${BUILD_DAY}.0" VIAddVersionKey /LANG=0x0804 "LegalCopyright" "msvc.win Project" +Unicode true SetCompressor /solid /final lzma - RequestExecutionLevel admin Function .onInit diff --git a/install_AtLeastWin10.nsi b/install_AtLeastWin10.nsi index f4e4095..71e51c5 100644 --- a/install_AtLeastWin10.nsi +++ b/install_AtLeastWin10.nsi @@ -24,8 +24,8 @@ VIAddVersionKey /LANG=0x0804 "FileDescription" "MSVC 运行时离线安装程序 VIAddVersionKey /LANG=0x0804 "FileVersion" "${BUILD_YEAR}.${BUILD_MONTH}.${BUILD_DAY}.0" VIAddVersionKey /LANG=0x0804 "LegalCopyright" "msvc.win Project" +Unicode true SetCompressor /solid /final lzma - RequestExecutionLevel admin Function .onInit diff --git a/install_AtLeastWin7.nsi b/install_AtLeastWin7.nsi index 5fb5e15..47b32bd 100644 --- a/install_AtLeastWin7.nsi +++ b/install_AtLeastWin7.nsi @@ -24,8 +24,8 @@ VIAddVersionKey /LANG=0x0804 "FileDescription" "MSVC 运行时离线安装程序 VIAddVersionKey /LANG=0x0804 "FileVersion" "${BUILD_YEAR}.${BUILD_MONTH}.${BUILD_DAY}.0" VIAddVersionKey /LANG=0x0804 "LegalCopyright" "msvc.win Project" +Unicode true SetCompressor /solid /final lzma - RequestExecutionLevel admin Function .onInit