From 9095b0d6b2605651c021e09e8a3f5c9ed13069a9 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Wed, 8 Jan 2025 18:04:08 +0100 Subject: [PATCH] Always run MSVC runtime installer --- .github/workflows/build.yml | 5 +++++ dist/windows/strawberry.nsi.in | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64d33046b..e0a1c72e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1452,6 +1452,11 @@ jobs: exit 1 fi + - name: Download MSVC runtime + shell: bash + working-directory: build + run: curl -f -O -L https://aka.ms/vs/17/release/vc_redist.$(test "${{matrix.arch}}" = "x86_64" && echo "x64" || echo "${{matrix.arch}}").exe + - name: Create nsis installer shell: cmd working-directory: build diff --git a/dist/windows/strawberry.nsi.in b/dist/windows/strawberry.nsi.in index 85a2e67c9..a9d984253 100644 --- a/dist/windows/strawberry.nsi.in +++ b/dist/windows/strawberry.nsi.in @@ -208,14 +208,16 @@ FunctionEnd !ifdef msvc !define vc_redist_file "vc_redist.${arch}.exe" Function InstallMSVCRuntime - ${registry::Read} "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\${arch}" "Version" $R0 $R1 - ${If} $R0 == "" + SetOutPath "$TEMP" + File "${vc_redist_file}" + ; ${registry::Read} "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\${arch}" "Version" $R0 $R1 + ; ${If} $R0 == "" SetDetailsView hide - inetc::get /caption "Downloading..." "https://aka.ms/vs/17/release/${vc_redist_file}" "$TEMP\${vc_redist_file}" /end + ; inetc::get /caption "Downloading..." "https://aka.ms/vs/17/release/${vc_redist_file}" "$TEMP\${vc_redist_file}" /end ExecWait '"$TEMP\${vc_redist_file}" /install /passive' Delete "$TEMP\${vc_redist_file}" SetDetailsView show - ${EndIf} + ; ${EndIf} FunctionEnd !endif