From 49fc709ed2bf510a658e0acbef2d3bd2e934e051 Mon Sep 17 00:00:00 2001 From: Brian Stansberry Date: Tue, 10 Oct 2023 13:45:14 -0500 Subject: [PATCH] [WFCORE-6552] Add missing search for WARNING to Windows package availability check --- .../common/src/main/resources/content/bin/common.bat | 2 +- .../common/src/main/resources/content/bin/common.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core-feature-pack/common/src/main/resources/content/bin/common.bat b/core-feature-pack/common/src/main/resources/content/bin/common.bat index f2f81831773..8bc1716aa46 100644 --- a/core-feature-pack/common/src/main/resources/content/bin/common.bat +++ b/core-feature-pack/common/src/main/resources/content/bin/common.bat @@ -16,7 +16,7 @@ if exist "%COMMON_CONF%" ( goto :eof :setPackageAvailable - "%JAVA%" --add-opens=%~1=ALL-UNNAMED -version >nul 2>&1 && (set PACKAGE_AVAILABLE=true) || (set PACKAGE_AVAILABLE=false) + "%JAVA%" --add-opens=%~1=ALL-UNNAMED -version | findstr /c:"WARNING" >nul 2>&1 && (set PACKAGE_AVAILABLE=true) || (set PACKAGE_AVAILABLE=false) goto :eof :setEnhancedSecurityManager diff --git a/core-feature-pack/common/src/main/resources/content/bin/common.ps1 b/core-feature-pack/common/src/main/resources/content/bin/common.ps1 index f27763e3483..7a72468cc8c 100644 --- a/core-feature-pack/common/src/main/resources/content/bin/common.ps1 +++ b/core-feature-pack/common/src/main/resources/content/bin/common.ps1 @@ -113,7 +113,7 @@ Function Get-Java-Opts { Function SetPackageAvailable($packageName) { $PACKAGE_AVAILABLE = $false - & $JAVA "--add-opens=$packageName=ALL-UNNAMED" -version >$null 2>&1 + & $JAVA "--add-opens=$packageName=ALL-UNNAMED" -version | Out-String -Stream | Select-String 'WARNING' -SimpleMatch -Quiet >$null 2>&1 if ($LastExitCode -eq 0){ $PACKAGE_AVAILABLE = $true }