From 21c658e4f1d7385f379ec7b971401677c0c376b0 Mon Sep 17 00:00:00 2001
From: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date: Thu, 07 May 2026 07:02:01 +0000
Subject: [PATCH] Harden Windows native build workflow checks

---
 .github/workflows/build.yml |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index ad45464..3c58d75 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -60,6 +60,10 @@
       if: runner.os == 'Windows'
       shell: cmd
       run: |
+        if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
+          echo Unable to locate vswhere.exe in the Visual Studio installer directory.
+          exit /b 1
+        )
         for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VSINSTALLDIR=%%i"
         if not defined VSINSTALLDIR (
           echo Unable to locate a Visual Studio installation with C++ build tools.
@@ -70,6 +74,10 @@
         pushd opendj-server-legacy\src\build-tools\windows
         nmake all
         if errorlevel 1 exit /b %errorlevel%
+        if not exist *.exe (
+          echo No Windows native executables were generated.
+          exit /b 1
+        )
         xcopy /Y *.exe ..\..\..\lib\
         if errorlevel 1 exit /b %errorlevel%
         popd

--
Gitblit v1.10.0