Closed bug report

Windows: install.sh aborts before installing the renderer and leaves a launcher that cannot find the package

AdityaAngajala · 19d ago ·closed by Colby Knox

Windows: install.sh aborts before installing the renderer and leaves a launcher that cannot find the package

Windows 11, Git for Windows bash, hero-studio 0.21.5. adom-wiki pkg install could not run the script at all (filed separately on adom/adom-wiki-cli), so I ran sh ./install.sh from the package directory by hand.

What happened

  • The ln -sfn "$PWD/bin/hero-studio" "$HOME/.local/bin/hero-studio" line succeeded, but Git Bash's ln -s makes a copy unless MSYS=winsymlinks:nativestrict is set. ~/.local/bin/hero-studio came out as a regular file.
  • bin/hero-studio finds the package with readlink -f "$0". For the copy that gives ~/.local/bin, so DIR becomes ~/.local and every verb would run node ~/.local/pose.mjs and so on. I replaced the copy with a two-line exec wrapper before trying it, so this part is read from the code, not observed.
  • The renderer step runs node -e "require('$PWD/renderer-paths.cjs')". In Git Bash $PWD is /c/Users/..., which Windows Node cannot resolve: MODULE_NOT_FOUND for /c/Users/<user>/project/adom_modules/adom/hero-studio/renderer-paths.cjs. Under set -e the failing PIN="$(node -e ...)" ends the script, so puppeteer-core is never installed and the doctor preflight never runs. The output gives no hint that the install is incomplete.

Suggested fix

  • Pass Node a native path: W="$(cygpath -m "$PWD" 2>/dev/null || echo "$PWD")" and require $W/renderer-paths.cjs. Or move the renderer step into a small install.mjs and use __dirname.
  • On Windows, write a wrapper instead of a symlink: ~/.local/bin/hero-studio containing exec "<package dir>/bin/hero-studio" "$@", plus a hero-studio.cmd so PowerShell and cmd users can run it.
  • Report a failed renderer step as a failure, not as silence.

2 Replies

Colby Knox · 19d ago

Fixed.

  • install.sh detects Git Bash, MSYS and Cygwin, and hands Node native paths (cygpath -m) for every require and for the doctor run.
  • On Windows it writes ~/.local/bin/hero-studio as a two-line exec wrapper rather than a symlink, plus hero-studio.cmd for PowerShell and cmd. The .cmd runs the launcher through bash on PATH, else Git's bash.exe.
  • The renderer directory comes from Node itself, so npm installs into the same C:\\Users\\...\\.cache\\hero-studio the studio reads.
  • A failed renderer step prints !! renderer dependency: FAILED with the command to run, and the script keeps going to the doctor preflight instead of ending under set -e.
  • The launcher also refuses a misplaced copy with the fix, honors HERO_STUDIO_HOME, and passes Node a native package path.

Shipped in hero-studio 0.22.0 (adom-wiki pkg install adom/hero-studio). Tested here on Linux, with the Windows and macOS branches driven by explicit inputs and a simulated desktop environment (no container proxy, no container key, a fresh home directory). I have no Windows machine to run it on, so please confirm on your desktop; if anything still breaks there, reopen with the output.

Colby Knox · 19d ago

Follow-up: this is now verified on a real Windows 11 machine (Node 24, PowerShell 5.1, Git for Windows, Chrome in Program Files), not only in the simulation:

  • With the adom-wiki fix for adom/adom-wiki-cli#62, adom-wiki pkg install adom/hero-studio ran install.sh. It wrote the wrapper and hero-studio.cmd and installed puppeteer-core into the user cache.
  • hero-studio doctor ran through the .cmd from PowerShell. puppeteer-core loaded, Chrome was found, the headless launch passed, and pup read as optional.
  • A server started from PowerShell, where HOME is not set, kept its state under C:\Users\<user>\.adom\instances and logged where it looked.
  • That server read the private adom/brand as confirmed through the desktop session.
  • Generate refused with STAMP_FAILED while Pillow was missing. After py -m pip install pillow it produced a stamped 2000x1250 PNG.
  • pose --surface browser opened the studio on 127.0.0.1 and waited for Generate.

That run found three more problems, fixed in hero-studio 0.22.1:

  • The .cmd picked WSL's bash. It now runs Git's bash by path, and only one interpreter, so a failing command is never retried.
  • doctor printed a Node/libuv assertion on exit on Windows.
  • A missing Pillow was remembered until the server restarted.

Log in to reply.