From 2dc6f7504b4cfb64b59b3eb905f1b1ac387b8c83 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Fri, 27 Sep 2024 00:18:35 -0700 Subject: [PATCH 01/10] add vc_redist as a NSIS install section Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- program_info/CMakeLists.txt | 15 +++++++++++++++ program_info/win_install.nsi.in | 2 ++ 2 files changed, 17 insertions(+) diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index 91b213274..90d038f4d 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -41,6 +41,21 @@ configure_file(org.prismlauncher.PrismLauncher.metainfo.xml.in org.prismlauncher configure_file(prismlauncher.rc.in prismlauncher.rc @ONLY) configure_file(prismlauncher.manifest.in prismlauncher.manifest @ONLY) configure_file(prismlauncher.ico prismlauncher.ico COPYONLY) + +if(MSVC) + set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION vc_redist) + include(InstallRequiredSystemLibraries) + file(TO_NATIVE_PATH ${MSVC_REDIST_DIR} Native_MSVC_REDIST_DIR) + set(Launcher_MSVC_Redist_NSIS_Section "\ +Section \"Visual Studio Runtime\" + SetOutPath \"$INSTDIR\\vc_redist\" + File \"${Native_MSVC_REDIST_DIR}\\vc_redist.x64.exe\" + ExecWait \"$INSTDIR\\vc_redist\\vc_redist.x64.exe /install /passive\" + ; Delete \"$INSTDIR\\vc_redist\\vc_redist.x64.exe\" +SectionEnd\ +") +endif() + configure_file(win_install.nsi.in win_install.nsi @ONLY) if(SCDOC_FOUND) diff --git a/program_info/win_install.nsi.in b/program_info/win_install.nsi.in index cc56b9bd5..c75e066bd 100644 --- a/program_info/win_install.nsi.in +++ b/program_info/win_install.nsi.in @@ -396,6 +396,8 @@ Section "@Launcher_DisplayName@" SectionEnd +@Launcher_MSVC_Redist_NSIS_Section@ + Section "Start Menu Shortcut" SM_SHORTCUTS CreateShortcut "$SMPROGRAMS\@Launcher_DisplayName@.lnk" "$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" "" "$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" 0 From 37d3b2a4f631d2a8ce3570a9c377576d4f5a3aa1 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Fri, 27 Sep 2024 00:49:00 -0700 Subject: [PATCH 02/10] prevent the unauthorised reditribution of MSVC CRT files Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- program_info/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index 90d038f4d..c9a1d597d 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -43,7 +43,7 @@ configure_file(prismlauncher.manifest.in prismlauncher.manifest @ONLY) configure_file(prismlauncher.ico prismlauncher.ico COPYONLY) if(MSVC) - set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION vc_redist) + set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP true) include(InstallRequiredSystemLibraries) file(TO_NATIVE_PATH ${MSVC_REDIST_DIR} Native_MSVC_REDIST_DIR) set(Launcher_MSVC_Redist_NSIS_Section "\ From c5daca3b013bd9cc8b17283d2a63e873480c2c16 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Fri, 27 Sep 2024 00:57:28 -0700 Subject: [PATCH 03/10] include vc_redist in portable build Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d70fe79b..49d3f731f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -372,6 +372,11 @@ endif() if(NOT (UNIX AND APPLE)) # Install "portable.txt" if selected component is "portable" install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_Portable_File}" DESTINATION "." COMPONENT portable EXCLUDE_FROM_ALL) + if (MSVC) + set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP true) + include(InstallRequiredSystemLibraries) + install(FILES "${MSVC_REDIST_DIR}/vc_redist.x64.exe" DESTINATION "vc_redist/." COMPONENT portable EXCLUDE_FROM_ALL ) + endif() endif() if(UNIX AND APPLE) From 8fa4467a362a55d10a3491a3b1d2301d3510383a Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Fri, 27 Sep 2024 13:29:00 -0700 Subject: [PATCH 04/10] use `/norestart` with redist install Co-authored-by: seth Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- program_info/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index c9a1d597d..0ce559406 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -50,7 +50,7 @@ if(MSVC) Section \"Visual Studio Runtime\" SetOutPath \"$INSTDIR\\vc_redist\" File \"${Native_MSVC_REDIST_DIR}\\vc_redist.x64.exe\" - ExecWait \"$INSTDIR\\vc_redist\\vc_redist.x64.exe /install /passive\" + ExecWait \"$INSTDIR\\vc_redist\\vc_redist.x64.exe /install /passive /norestart\" ; Delete \"$INSTDIR\\vc_redist\\vc_redist.x64.exe\" SectionEnd\ ") From 00f4221a836bc747ec8d220a52e7b96ed24f871a Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Fri, 27 Sep 2024 19:16:50 -0700 Subject: [PATCH 05/10] reorg MSVC set(CMAKE_INSTALL_SYSTEM_RUNTIMES_LIBS_SKIP true) call Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- CMakeLists.txt | 6 ++++-- program_info/CMakeLists.txt | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49d3f731f..cea61ddbf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -358,6 +358,10 @@ include(ECMQtDeclareLoggingCategory) ####################################### Program Info ####################################### set(Launcher_APP_BINARY_NAME "prismlauncher" CACHE STRING "Name of the Launcher binary") +if(MSVC) + set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP true) + include(InstallRequiredSystemLibraries) +endif() add_subdirectory(program_info) ####################################### Install layout ####################################### @@ -373,8 +377,6 @@ if(NOT (UNIX AND APPLE)) # Install "portable.txt" if selected component is "portable" install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_Portable_File}" DESTINATION "." COMPONENT portable EXCLUDE_FROM_ALL) if (MSVC) - set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP true) - include(InstallRequiredSystemLibraries) install(FILES "${MSVC_REDIST_DIR}/vc_redist.x64.exe" DESTINATION "vc_redist/." COMPONENT portable EXCLUDE_FROM_ALL ) endif() endif() diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index 0ce559406..8a7d4868f 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -43,7 +43,6 @@ configure_file(prismlauncher.manifest.in prismlauncher.manifest @ONLY) configure_file(prismlauncher.ico prismlauncher.ico COPYONLY) if(MSVC) - set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP true) include(InstallRequiredSystemLibraries) file(TO_NATIVE_PATH ${MSVC_REDIST_DIR} Native_MSVC_REDIST_DIR) set(Launcher_MSVC_Redist_NSIS_Section "\ From ed15a28eb3af1487cff7b81ed06b91afd35de4a0 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Sat, 28 Sep 2024 14:58:13 -0700 Subject: [PATCH 06/10] fix : baking the redist into the installer breaks GPL, download at runtime instead Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- .github/workflows/build.yml | 3 +++ CMakeLists.txt | 7 ------- program_info/CMakeLists.txt | 25 +++++++++++++++---------- program_info/win_install.nsi.in | 23 +++++++++++++++++++++++ 4 files changed, 41 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ccba62541..7345ffe90 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -471,6 +471,9 @@ jobs: - name: Package (Windows, installer) 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 cd ${{ env.INSTALL_DIR }} makensis -NOCD "${{ github.workspace }}/${{ env.BUILD_DIR }}/program_info/win_install.nsi" diff --git a/CMakeLists.txt b/CMakeLists.txt index cea61ddbf..3d70fe79b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -358,10 +358,6 @@ include(ECMQtDeclareLoggingCategory) ####################################### Program Info ####################################### set(Launcher_APP_BINARY_NAME "prismlauncher" CACHE STRING "Name of the Launcher binary") -if(MSVC) - set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP true) - include(InstallRequiredSystemLibraries) -endif() add_subdirectory(program_info) ####################################### Install layout ####################################### @@ -376,9 +372,6 @@ endif() if(NOT (UNIX AND APPLE)) # Install "portable.txt" if selected component is "portable" install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_Portable_File}" DESTINATION "." COMPONENT portable EXCLUDE_FROM_ALL) - if (MSVC) - install(FILES "${MSVC_REDIST_DIR}/vc_redist.x64.exe" DESTINATION "vc_redist/." COMPONENT portable EXCLUDE_FROM_ALL ) - endif() endif() if(UNIX AND APPLE) diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index 8a7d4868f..30a435866 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -43,16 +43,21 @@ configure_file(prismlauncher.manifest.in prismlauncher.manifest @ONLY) configure_file(prismlauncher.ico prismlauncher.ico COPYONLY) if(MSVC) - include(InstallRequiredSystemLibraries) - file(TO_NATIVE_PATH ${MSVC_REDIST_DIR} Native_MSVC_REDIST_DIR) - set(Launcher_MSVC_Redist_NSIS_Section "\ -Section \"Visual Studio Runtime\" - SetOutPath \"$INSTDIR\\vc_redist\" - File \"${Native_MSVC_REDIST_DIR}\\vc_redist.x64.exe\" - ExecWait \"$INSTDIR\\vc_redist\\vc_redist.x64.exe /install /passive /norestart\" - ; Delete \"$INSTDIR\\vc_redist\\vc_redist.x64.exe\" -SectionEnd\ -") + set(Launcher_MSVC_Redist_NSIS_Section [=[ +!ifdef haveNSIScurl +Section "Visual Studio Runtime" + 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 + Pop $0 + ${If} $0 == "OK" + DetailPrint "Download successful" + ExecWait "$INSTDIR\vc_redist\vc_redist.x64.exe /install /passive /norestart\" + ${Else} + DetailPrint "Download failed with error $0" + ${EndIf} +SectionEnd +!endif +]=]) endif() configure_file(win_install.nsi.in win_install.nsi @ONLY) diff --git a/program_info/win_install.nsi.in b/program_info/win_install.nsi.in index c75e066bd..a5c38599d 100644 --- a/program_info/win_install.nsi.in +++ b/program_info/win_install.nsi.in @@ -112,6 +112,16 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "@Launcher_Copyright@" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "@Launcher_VERSION_NAME4@" VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "@Launcher_VERSION_NAME4@" +;-------------------------------- +; Conditional comp with file exist + +!macro CompileTimeIfFileExist path define +!tempfile tmpinc +!system 'IF EXIST "${path}" echo !define ${define} > "${tmpinc}"' +!include "${tmpinc}" +!delfile "${tmpinc}" +!undef tmpinc +!macroend ;-------------------------------- ; Shell Associate Macros @@ -336,6 +346,19 @@ Section "" UninstallPrevious SectionEnd +;------------------------------------ +; include nice plugins + +; NSIScurl - curl in NSIS +; used for MSVS redist download +; extract to ../NSISPlugins/NSIScurl +; 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" +!endif ;------------------------------------ From bcb1d456d4773f985d3b18d42382400a2c8148e7 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Thu, 3 Oct 2024 21:56:19 -0700 Subject: [PATCH 07/10] 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> --- .github/workflows/build.yml | 13 +++++++++++-- program_info/CMakeLists.txt | 12 +++++++++--- program_info/win_install.nsi.in | 14 +++++++------- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7345ffe90..16c9290f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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" diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index 30a435866..8fb6f68aa 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -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} diff --git a/program_info/win_install.nsi.in b/program_info/win_install.nsi.in index a5c38599d..c0e2b892f 100644 --- a/program_info/win_install.nsi.in +++ b/program_info/win_install.nsi.in @@ -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 ;------------------------------------ From 63172540fb467386864ae22356999451dd2ebe08 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Thu, 3 Oct 2024 22:38:30 -0700 Subject: [PATCH 08/10] fix: nisi needs `!include` "x64.nsh" now. also, there were some broken varible Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- program_info/CMakeLists.txt | 4 ++-- program_info/win_install.nsi.in | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index 8fb6f68aa..ee2e336b1 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -53,11 +53,11 @@ Section "Visual Studio Runtime" 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_exe}" "$INSTDIR\vc_redist\${vc_redist_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_exe} /install /passive /norestart\" + ExecWait "$INSTDIR\vc_redist\$vc_redist_exe /install /passive /norestart\" ${Else} DetailPrint "Download failed with error $0" ${EndIf} diff --git a/program_info/win_install.nsi.in b/program_info/win_install.nsi.in index c0e2b892f..24f6ee4e8 100644 --- a/program_info/win_install.nsi.in +++ b/program_info/win_install.nsi.in @@ -2,6 +2,8 @@ !include "LogicLib.nsh" !include "MUI2.nsh" +!include "x64.nsh" + Unicode true Name "@Launcher_DisplayName@" @@ -185,7 +187,7 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "@Launcher_VERSION_NAME4@ !macroend -!macro APP_UNASSOCIATE EXT APP_ID +!macro APP_UNASSOCIATE EXT APP_ID APP_EXE # Unregister file type ClearErrors @@ -489,8 +491,8 @@ Section -un.ShellAssoc !insertmacro APP_TEARDOWN_DEFAULT `${APPID}` `${APPNAME}` `${APPEXE}` - !insertmacro APP_UNASSOCIATE ".zip" `${APPID}` - !insertmacro APP_UNASSOCIATE ".mrpack" `${APPID}` + !insertmacro APP_UNASSOCIATE ".zip" `${APPID}` `${APPEXE}` + !insertmacro APP_UNASSOCIATE ".mrpack" `${APPID}` `${APPEXE}` !insertmacro NotifyShell_AssocChanged SectionEnd From 023aa18e852ab1b570b378609edee1e7bbcd1588 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Thu, 3 Oct 2024 23:14:29 -0700 Subject: [PATCH 09/10] ci: NSCurl only needed on MSVC Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- .github/workflows/build.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16c9290f2..4063df355 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -475,14 +475,16 @@ jobs: - name: Package (Windows, installer) if: runner.os == 'Windows' run: | - New-Item -Name NSISPlugins -ItemType Directory - 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 + if ('${{ matrix.nscurl_tag }}') { + New-Item -Name NSISPlugins -ItemType Directory + 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 } - 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" From a61c93bedefced10b59c310daa567e31cb30f967 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Fri, 4 Oct 2024 07:06:19 -0700 Subject: [PATCH 10/10] Update .github/workflows/build.yml Co-authored-by: Sefa Eyeoglu Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4063df355..98caa901d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -480,7 +480,7 @@ jobs: 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" + echo "::error:: NSCurl.zip sha256 mismatch" exit 1 } Expand-Archive -Path NSISPlugins\NScurl.zip -DestinationPath NSISPlugins\NScurl