diff options
| author | xxanqw <[email protected]> | 2025-11-26 12:27:36 +0200 |
|---|---|---|
| committer | xxanqw <[email protected]> | 2025-11-26 12:28:51 +0200 |
| commit | cc5c6ba5536e65cf5ab78854448d931c93d3c12a (patch) | |
| tree | 7f6c025e69c813cf81d181737f4582432e5c90ea /.github/workflows | |
| parent | b28282b9114d459ea669ccd35a984cdb6eb6f732 (diff) | |
| download | mikusays-c-cc5c6ba5536e65cf5ab78854448d931c93d3c12a.tar.gz mikusays-c-cc5c6ba5536e65cf5ab78854448d931c93d3c12a.zip | |
Add VC++ Redistributable 2022 installation to NSIS script
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/package-win.yml | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/.github/workflows/package-win.yml b/.github/workflows/package-win.yml index 2b2f607..5a98fa8 100644 --- a/.github/workflows/package-win.yml +++ b/.github/workflows/package-win.yml @@ -82,6 +82,7 @@ jobs: !include "LogicLib.nsh" !include "x64.nsh" !include "WinVer.nsh" + !include "nsisdl.nsh" ; --- Helper Macros (MUST BE DEFINED BEFORE USE) --- !macro StrContains ResultVar Needle Haystack @@ -179,6 +180,10 @@ jobs: !define StrRep `!insertmacro StrRep` !define un.StrRep `!insertmacro un.StrRep` + ; --- VC++ Redistributable 2022 Download and Install --- + !define VC_REDIST_URL "https://aka.ms/vs/17/release/vc_redist.x64.exe" + !define VC_REDIST_EXE "$TEMP\vc_redist.x64.exe" + ; --- Main Script --- Name "Mikusays" OutFile "__OUTFILE__" @@ -207,7 +212,7 @@ jobs: Section "Install" SetOutPath "$INSTDIR" - + ; Architecture Detection ReadEnvStr $0 "PROCESSOR_ARCHITECTURE" ${If} $0 == "ARM64" @@ -225,6 +230,21 @@ jobs: WriteRegExpandStr HKCU "Environment" "Path" "$0;$INSTDIR" SendMessage ${HWND_BROADCAST} ${WM_SETTINGCHANGE} 0 "STR:Environment" /TIMEOUT=5000 ${EndIf} + + ; Install VC++ Redistributable 2022 (silent install) + MessageBox MB_OKCANCEL "This installer requires Microsoft Visual C++ Redistributable 2022.$\n$\nClick OK to download and install it now." IDOK download_vc + Abort "Microsoft Visual C++ Redistributable 2022 is required to run this application." + download_vc: + nsisdl::download /TIMEOUT=30000 "${VC_REDIST_URL}" "${VC_REDIST_EXE}" + Pop $0 + ${If} $0 == "success" + ExecWait '"${VC_REDIST_EXE}" /install /quiet /norestart' $1 + ${If} $1 != 0 + MessageBox MB_OK "Failed to install Microsoft Visual C++ Redistributable 2022 (Error $1).$\n$\nYou may need to install it manually from:$\n${VC_REDIST_URL}" + ${EndIf} + ${Else} + MessageBox MB_OK "Failed to download Microsoft Visual C++ Redistributable 2022.$\n$\nYou can install it manually from:$\n${VC_REDIST_URL}" + ${EndIf} SectionEnd Section "Uninstall" @@ -239,6 +259,9 @@ jobs: ${un.StrRep} $0 "$0" "$INSTDIR" "" WriteRegExpandStr HKCU "Environment" "Path" "$0" SendMessage ${HWND_BROADCAST} ${WM_SETTINGCHANGE} 0 "STR:Environment" /TIMEOUT=5000 + + ; Clean up VC++ Redistributable installer if it exists + Delete "${VC_REDIST_EXE}" SectionEnd '@ |
