[#693] Fix Windows scripts for install paths with spaces and parentheses#671
Open
vharseko wants to merge 4 commits into
Open
[#693] Fix Windows scripts for install paths with spaces and parentheses#671vharseko wants to merge 4 commits into
vharseko wants to merge 4 commits into
Conversation
…aces) _script-util.bat appends -Djava.io.tmpdir=%OPENDJ_TMP_DIR% to OPENDJ_JAVA_ARGS without quotes, so in any install directory containing spaces (for example C:\Program Files (x86)\OpenDJ) the CheckJVMVersion probe - and with it setup and every other command-line tool - fails with "The detected Java version could not be used with the set of Java arguments". Quote the value: -Djava.io.tmpdir="%OPENDJ_TMP_DIR%".
vharseko
added a commit
to vharseko/OpenDJ
that referenced
this pull request
Jul 2, 2026
Drop the OPENDJ=C:\opendj override so the MSI test exercises the default install directory (C:\Program Files (x86)\OpenDJ), which contains spaces - covering the java.io.tmpdir quoting fix merged from PR OpenIdentityPlatform#671.
maximthomas
approved these changes
Jul 2, 2026
…cp.bat) _script-util.bat passed unquoted paths to setcp.bat, and setcp.bat compared arguments with if ""%1""=="""". The argument-joining hack survived spaces, but a parenthesis in the path (C:\Program Files (x86)\OpenDJ - the default MSI directory) breaks the cmd parser with "... was unexpected at this time", so setup.bat and every tool exit with 255. Quote the setcp.bat arguments at the three call sites and switch setcp.bat to %~1 with quoted comparisons.
maximthomas
approved these changes
Jul 3, 2026
…e "%VAR%" == "" comparisons
After -Djava.io.tmpdir="%OPENDJ_TMP_DIR%" is appended, OPENDJ_JAVA_ARGS
contains embedded quotes, and the subsequent if "%OPENDJ_JAVA_ARGS%" == ""
checks blow up the cmd parser ('...\tmp"" was unexpected at this time', every
tool exits 255) regardless of whether the install path has spaces. Compare
with "if defined", which does not expand the value.
The tmp-cleanup block expands %OPENDJ_TMP_DIR% unquoted inside a ( ) compound statement, so a parenthesis in the install path - C:\Program Files (x86)\OpenDJ - terminates the block at parse time and start-ds fails; the Windows service then dies with a service-specific error -1 while setup (which never runs this block) succeeds. Quote the three path expansions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #693
Two quoting defects in the Windows scripts break any install directory containing spaces and/or parentheses — including the default MSI locations
C:\Program Files (x86)\OpenDJ(x86) andC:\Program Files\OpenDJ.1. Unquoted
java.io.tmpdir_script-util.batappends the temp-dir Java argument without quotes:With spaces in the path the argument splits and the
CheckJVMVersionprobe fails;setup.batand every tool abort with "The detected Java version could not be used…". Reproduced in CI by installing the released 5.1.1 MSI into its default directory (failing job). Fixed by quoting the value.2. Classpath building breaks on parentheses
_script-util.batpassed unquoted paths tosetcp.bat, andsetcp.batcompared arguments withif ""%1""=="""". The argument-joining hack survived spaces, but a parenthesis in the path —(x86)— breaks the cmd parser with "… was unexpected at this time", sosetup.batexits with 255 (failing job). Fixed by quoting thesetcp.batarguments at the three call sites and switchingsetcp.batto%~1with quoted comparisons.Both defects date back to the original scripts and affect every delivery (zip and MSI) installed into a path with spaces/parentheses.