fix: version NSCurl plugin in workflow, detect and use arm64 vc_redist for arm64

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers 2024-10-03 21:56:19 -07:00
parent ed15a28eb3
commit bcb1d456d4
No known key found for this signature in database
GPG Key ID: E10E321EB160949B
3 changed files with 27 additions and 12 deletions

View File

@ -81,6 +81,8 @@ jobs:
qt_arch: ""
qt_version: "6.7.2"
qt_modules: "qt5compat qtimageformats qtnetworkauth"
nscurl_tag: "v24.9.26.122"
nscurl_sha256: "AEE6C4BE3CB6455858E9C1EE4B3AFE0DB9960FA03FE99CCDEDC28390D57CCBB0"
- os: windows-2022
name: "Windows-MSVC-arm64"
@ -92,6 +94,8 @@ jobs:
qt_arch: "win64_msvc2019_arm64"
qt_version: "6.7.2"
qt_modules: "qt5compat qtimageformats qtnetworkauth"
nscurl_tag: "v24.9.26.122"
nscurl_sha256: "AEE6C4BE3CB6455858E9C1EE4B3AFE0DB9960FA03FE99CCDEDC28390D57CCBB0"
- os: macos-14
name: macOS
@ -472,8 +476,13 @@ jobs:
if: runner.os == 'Windows'
run: |
New-Item -Name NSISPlugins -ItemType Directory
Invoke-Webrequest https://github.com/negrutiu/nsis-nscurl/releases/latest/download/NScurl.zip -OutFile NSISPlugins\NScurl.zip
Expand-Archive -Path NSISPlugins\NScurl.zip -DestinationPath NSISPlugins\NSIScurl
Invoke-Webrequest https://github.com/negrutiu/nsis-nscurl/releases/download/${{ matrix.nscurl_tag }}/NScurl.zip -OutFile NSISPlugins\NScurl.zip
$nscurl_hash = Get-FileHash NSISPlugins\NScurl.zip -Algorithm Sha256 | Select-Object -ExpandProperty Hash
if ( $nscurl_hash -ne "${{ matrix.nscurl_sha256 }}") {
echo "::error:: NSCurl.zib sha256 mismatch"
exit 1
}
Expand-Archive -Path NSISPlugins\NScurl.zip -DestinationPath NSISPlugins\NScurl
cd ${{ env.INSTALL_DIR }}
makensis -NOCD "${{ github.workspace }}/${{ env.BUILD_DIR }}/program_info/win_install.nsi"

View File

@ -44,14 +44,20 @@ configure_file(prismlauncher.ico prismlauncher.ico COPYONLY)
if(MSVC)
set(Launcher_MSVC_Redist_NSIS_Section [=[
!ifdef haveNSIScurl
!ifdef haveNScurl
Section "Visual Studio Runtime"
Var /GLOBAL vc_redist_exe
${If} ${IsNativeARM64}
StrCpy $vc_redist_exe "vc_redist.arm64.exe"
${Else}
StrCpy $vc_redist_exe "vc_redist.x64.exe"
${EndIf}
DetailPrint 'Downloading Microsoft Visual C++ Redistributable...'
NScurl::http GET "https://aka.ms/vs/17/release/vc_redist.x64.exe" "$INSTDIR\vc_redist\vc_redist.x64.exe" /INSIST /CANCEL /Zone.Identifier /END
NScurl::http GET "https://aka.ms/vs/17/release/${vc_redist_exe}" "$INSTDIR\vc_redist\${vc_redist_exe}" /INSIST /CANCEL /Zone.Identifier /END
Pop $0
${If} $0 == "OK"
DetailPrint "Download successful"
ExecWait "$INSTDIR\vc_redist\vc_redist.x64.exe /install /passive /norestart\"
ExecWait "$INSTDIR\vc_redist\${vc_redist_exe} /install /passive /norestart\"
${Else}
DetailPrint "Download failed with error $0"
${EndIf}

View File

@ -349,15 +349,15 @@ SectionEnd
;------------------------------------
; include nice plugins
; NSIScurl - curl in NSIS
; NScurl - curl in NSIS
; used for MSVS redist download
; extract to ../NSISPlugins/NSIScurl
; extract to ../NSISPlugins/NScurl
; https://github.com/negrutiu/nsis-nscurl/releases/latest/download/NScurl.zip
!insertmacro CompileTimeIfFileExist "../NSISPlugins/NSIScurl/Plugins/" haveNSIScurl
!ifdef haveNSIScurl
!AddPluginDir /x86-unicode "../NSISPlugins/NSIScurl/Plugins/x86-unicode"
!AddPluginDir /x86-ansi "../NSISPlugins/NSIScurl/Plugins/x86-ansi"
!AddPluginDir /amd64-unicode "../NSISPlugins/NSIScurl/Plugins/amd64-unicode"
!insertmacro CompileTimeIfFileExist "../NSISPlugins/NScurl/Plugins/" haveNScurl
!ifdef haveNScurl
!AddPluginDir /x86-unicode "../NSISPlugins/NScurl/Plugins/x86-unicode"
!AddPluginDir /x86-ansi "../NSISPlugins/NScurl/Plugins/x86-ansi"
!AddPluginDir /amd64-unicode "../NSISPlugins/NScurl/Plugins/amd64-unicode"
!endif
;------------------------------------