File 0186-adds-nsis-to-windows-2025.patch of Package erlang

From 1d1eab90511399bdf69418772870717ad5b26a13 Mon Sep 17 00:00:00 2001
From: Kiko Fernandez-Reyes <kiko@erlang.org>
Date: Wed, 6 Aug 2025 13:49:38 +0200
Subject: [PATCH] adds nsis to windows-2025

windows-2022 came with makensis but windows-2025 removed it.

Notes here:
- https://github.com/actions/runner-images/issues/12677
---
 .github/workflows/main.yaml  | 8 +++++++-
 erts/etc/win32/nsis/Makefile | 8 ++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index f7e67ad20f..b42c2613fa 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -262,7 +262,7 @@ jobs:
     env:
       WXWIDGETS_VERSION: 3.2.6
     name: Build Erlang/OTP (Windows)
-    runs-on: windows-2022
+    runs-on: windows-2025
     needs: pack
     if: needs.pack.outputs.build-c-code == 'true'
     steps:
@@ -273,6 +273,11 @@ jobs:
       - name: Install WSL dependencies
         run: apt update && apt install -y make autoconf unzip
 
+      - name: Install NSIS
+        shell: cmd
+        run: |
+          choco install nsis --version 3.11.0
+
       - name: Install openssl
         shell: cmd
         run: |
@@ -332,6 +337,7 @@ jobs:
           cp -R wxWidgets /mnt/c/opt/local64/pgm/wxWidgets-${{ env.WXWIDGETS_VERSION }}
           tar -xzf ./otp_src.tar.gz
           cd otp
+          export PATH="/mnt/c/Program Files (x86)/NSIS/bin":$PATH
           export ERL_TOP=`pwd`
           export MAKEFLAGS=-j$(($(nproc) + 2))
           export ERLC_USE_SERVER=true
diff --git a/erts/etc/win32/nsis/Makefile b/erts/etc/win32/nsis/Makefile
index dd4bbd4de6..84fb7ec1df 100644
--- a/erts/etc/win32/nsis/Makefile
+++ b/erts/etc/win32/nsis/Makefile
@@ -77,7 +77,9 @@ release_spec:
 	@NSIS_VER=`makensis.exe -version`; \
 	case $$NSIS_VER in \
 	v2.* | v3.0 | v3.01) \
-	  echo "Unsupported NSIS version: $$NSIS_VER";;\
+	  echo "Unsupported NSIS version: $$NSIS_VER";\
+		exit -1;\
+	  ;;\
 	v3.*) \
 	  echo '!define OTP_RELEASE "$(SYSTEM_VSN)"' > $(VERSION_HEADER);\
 	  echo '!define OTP_VERSION "$(OTP_VERSION)"' >> $(VERSION_HEADER);\
@@ -108,7 +110,9 @@ release_spec:
 	  echo "Running $(MAKENSIS) $(MAKENSISFLAGS) erlang20.nsi";\
 	  $(MAKENSIS) $(MAKENSISFLAGS) erlang20.nsi;;\
 	*) \
-	  echo "Unsupported NSIS version: $$NSIS_VER";;\
+	  echo "Unsupported NSIS version: $$NSIS_VER";\
+	  exit -1;\
+	  ;;\
 	esac	
 
 release_docs release_docs_spec docs:
-- 
2.51.0

openSUSE Build Service is sponsored by