Skip to content

Commit

Permalink
[WFCORE-6552] Add missing search for WARNING to Windows package avail…
Browse files Browse the repository at this point in the history
…ability check
  • Loading branch information
bstansberry committed Oct 10, 2023
1 parent 98b9d18 commit babd610
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 /i /c:"WARNING" >nul 2>&1 && (set PACKAGE_AVAILABLE=false) || (set PACKAGE_AVAILABLE=true)
goto :eof

:setEnhancedSecurityManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ Function Get-Java-Opts {
}

Function SetPackageAvailable($packageName) {
$PACKAGE_AVAILABLE = $false
& $JAVA "--add-opens=$packageName=ALL-UNNAMED" -version >$null 2>&1
$PACKAGE_AVAILABLE = $true
& $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
$PACKAGE_AVAILABLE = $false
}
return $PACKAGE_AVAILABLE
}
Expand Down

0 comments on commit babd610

Please sign in to comment.