Skip to content

Windows scripts fail when OpenDJ is installed into a path with spaces or parentheses (default MSI locations) #693

Description

@vharseko

Summary

On Windows, setup.bat and every other tool script fail when OpenDJ is installed into a directory containing spaces and/or parentheses — including the default MSI locations C:\Program Files\OpenDJ and C:\Program Files (x86)\OpenDJ.

Steps to reproduce

  1. Install the released MSI (or unpack the zip) into the default location, e.g. C:\Program Files (x86)\OpenDJ.
  2. Run setup.bat (or any tool script).

Actual behaviour

Two independent quoting defects in the scripts:

  1. Unquoted java.io.tmpdir_script-util.bat appends the temp-dir Java argument without quotes:

    set OPENDJ_JAVA_ARGS=%OPENDJ_JAVA_ARGS% -Djava.io.tmpdir=%OPENDJ_TMP_DIR%

    With spaces in the path the argument splits and the CheckJVMVersion probe fails; setup.bat and 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: https://github.com/vharseko/OpenDJ/actions/runs/28599532189/job/84844211518

  2. Classpath building breaks on parentheses_script-util.bat passes unquoted paths to setcp.bat, and setcp.bat compares arguments with if ""%1""=="""". The argument-joining hack survives spaces, but a parenthesis in the path — (x86) — breaks the cmd parser with "… was unexpected at this time", so setup.bat exits with 255: https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/28613924513/job/84936550267

Expected behaviour

All scripts work from any install directory, including paths with spaces and parentheses.

Affected versions

Both defects date back to the original scripts and affect every delivery (zip and MSI) installed into such a path.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions