Skip to content

Windows installer matching the macOS installer (hash-locked uv install) - #1743

Open
barentine wants to merge 1 commit into
python-microscopy:masterfrom
barentine:winstaller
Open

barentine wants to merge 1 commit into
python-microscopy:masterfrom
barentine:winstaller

Conversation

@barentine

Copy link
Copy Markdown
Member

@David-Baddeley I don't want to generate a bunch of review overhead for you, but since I have access to a windows box thought I would give this a go.
Proposed changes:
Used claude code to bring the window's installer in line with the current macOS installer:

  • install-python-microscopy.bat is now generated from a .bat.in template by build-install-python-microscopy.sh, which compiles one lock and embeds it in both the .sh and the .bat. Uses a uv-managed Python, a relocatable venv and uv pip sync --require-hashes (replacing py-app-standalone).
  • The InnoSetup installer (~2 MB) ships the .bat and runs it on the user's machine. A venv built in CI can't be shipped because pyvenv.cfg points at the build machine. Needs internet at install time; per-user only.
  • Disables Inno 6.7+'s RedirectionGuard, which otherwise blocks uv from following the junctions in its Python directory (os error 448).
  • CI: an ubuntu job builds both scripts; the windows job runs ISCC on the .bat.

Tested locally: build, .bat install, and installer install/launch on Windows 11. The macOS .sh output is byte-identical to before. Not tested: the CI run.

The installer only installs for current user and does not offer the option to install for all users (seems like it would be a mess otherwise).

The built exe works well locally. I can also install a plugin
image
image
The start menu icons are set up as well
image

- install-python-microscopy.bat is now generated from a .bat.in template,
  with the same universal, hash-locked requirements embedded as the .sh
  installer. It installs a uv-managed Python, creates a relocatable venv
  and runs `uv pip sync --require-hashes` (replacing py-app-standalone).
  Adds --dest/--yes and a confirm-before-overwrite prompt; on overwrite
  only the items the script created are removed.
- build-install-python-microscopy.sh compiles the lock once and embeds it
  in both the .sh and .bat (CRLF) installers.
- pyme_setup.iss ships the generated .bat and runs it on the target
  machine (a venv built in CI can't be relocated to another machine).
  Per-user install only, since the uv-managed Python lives in the user's
  profile. Logs to {app}\install.log, reports failures, cleans up on
  uninstall, and disables Inno 6.7+'s RedirectionGuard, which otherwise
  blocks uv from following junctions in its Python directory (os error 448).
- make_installers.yaml: an ubuntu job builds both scripts from one lock;
  the windows job runs ISCC on the generated .bat.
- Ignore generated installer outputs; update INSTALLERS.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant