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
3 changed files with 27 additions and 12 deletions

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
;------------------------------------