Skip to content

Verify install.ps1 (#180) on real Windows: cmd.exe .bat execution, PowerShell 5.1, irm|iex, Java floor #181

Description

@fupelaqu

Verification task for #180 (fixes #179), which rewrites install.ps1 and both generated Windows launchers.

Why this needs its own issue: #180 was developed and tested on macOS with PowerShell 7.4.5 against a local mirror of the artifact repo. That covers version resolution, both install paths, licence extraction, and the launcher's java invocation — but it can never cover cmd.exe or Windows PowerShell 5.1, which is the version that ships with Windows. Two HIGH-severity bugs in the generated .bat were already caught by code review (cmd expands every %VAR% in a parenthesised block in one parse pass, so a quote-strip inside the block was dead code and if defined X if %X% GEQ 9 guarded nothing). Both are fixed, but neither was executed — that is what this issue is for.

Do not merge #180 on the strength of the macOS testing alone.

1. cmd.exe running the generated bin\softclient4es.bat

The least-tested file in the change. The Java-major parse is the risky part.

  • JAVA_MAJOR is a bare integer (not "11, not empty). Add a temporary echo JAVA_MAJOR=[%JAVA_MAJOR%] before the java line.
  • --add-opens actually reaches the JVM: temporary echo EXTRA_OPTS=[%EXTRA_OPTS%], expect --add-opens=java.base/java.nio=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true on Java 9+. This is the flag pair the whole ticket exists to deliver; if it is empty, the Arrow/DuckDB JOIN path is still broken.
  • No cmd syntax error on stderr (e.g. 9 was unexpected at this time.) on any run.
  • java absent from PATH → clean Error: Java is not installed. Java 11+ is required. and exit code 1, not a parse error or a silent start.
  • Install path containing a space — both C:\Program Files\softclient4es and the default C:\Users\<name with space>\softclient4es. The default matters most: %USERPROFILE% routinely contains a space, so this is the common case, not the exotic one. Expect no Could not find or load main class.
  • Argument containing spaces: softclient4es.bat -c "SELECT * FROM my_index WHERE name = 'John Doe'".
  • Argument containing a double quote: e.g. a quoted SQL identifier, -c "SELECT \"field\" FROM idx" — confirm what actually reaches the CLI.
  • A real cross-index JOIN returns rows (the end-to-end proof that -cp + lib\* works on Windows).

2. Windows PowerShell 5.1 — the whole installer

Not just 7.x. Run .\install.ps1 end to end and check:

  • Bundle resolution picks the -all bundle and its own version line.
  • HEAD probe through a corporate proxy (Test-UrlExists) — confirm it does not spuriously return false and demote every install to the plain artifact.
  • The 309 MB download completes, and time it. $ProgressPreference is set to SilentlyContinue around it precisely because 5.1's per-chunk Write-Progress makes a download this size crawl while showing nothing. If it still takes many minutes, say so — the fallback is System.Net.WebClient.DownloadFile.
  • Licence extraction produces licenses\ (3 files) + NOTICE via System.IO.Compression on 5.1 (7.x has the types preloaded; 5.1 needs the Add-Type).
  • Both launchers are generated and work.
  • -NoExtensions and -ListVersions behave as on 7.x.

3. bin\softclient4es.ps1 under 5.1

  • $env:JAVA_OPTS unset → defaults to -Xmx512m.
  • $env:JAVA_OPTS single flag (-Xmx1g).
  • $env:JAVA_OPTS multi flag (-Xmx1g -XX:+UseG1GC) — each must arrive as its own argument.
  • $env:JAVA_OPTS with a leading space (" -Xmx2g") — the empty element must be dropped; otherwise java reads "" as the main class and refuses to start.
  • Double-quoted SQL identifier in -c: 5.1's native argument quoting mangles embedded " where 7.3+ does not. Establish what actually works on 5.1 and document it if the two differ.
  • Exit status propagates (exit $LASTEXITCODE): run a failing statement, check $LASTEXITCODE.

4. irm … | iex — the documented entry point

README.md:31 and documentation/client/repl.md:81 both tell Windows users to run:

irm https://raw.githubusercontent.com/SOFTNETWORK-APP/SoftClient4ES/main/install.ps1 | iex
  • Confirm the script's param() block and its exit calls behave under iex. An exit inside iex terminates the host session, so any error path (bad ES version, missing Java, failed download) may close the user's PowerShell window rather than print an error.
  • No arguments can be passed this way — confirm the defaults alone give a working install, and that -NoExtensions / -Version require the download-then-run form. If so, the docs should say it.

5. Java floor and ES 9

Reporting

Please record the actual output for anything that fails, plus $PSVersionTable.PSVersion, the Windows build, and the JDK vendor/version — the Java-version parse depends on the exact java -version text, and vendor differences are a plausible source of divergence.

Known gaps, not part of this verification

AppCDS is deliberately not ported to Windows in #180 (a pure cold-start optimisation; install.sh generates the archive at install time on JDK 13-18 and passes -XX:+AutoCreateSharedArchive on 19+). Worth a separate issue if Windows cold start matters. Also absent by design: the ELASTIC_* empty-env-unset loop, benign on Windows because setting an env var to "" deletes it there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions