Skip to content

feat(build): cross-platform build-and-install with Windows shell integration#202

Open
hughesyadaddy wants to merge 1 commit into
TomBadash:masterfrom
hughesyadaddy:feat/cross-platform-build-install
Open

feat(build): cross-platform build-and-install with Windows shell integration#202
hughesyadaddy wants to merge 1 commit into
TomBadash:masterfrom
hughesyadaddy:feat/cross-platform-build-install

Conversation

@hughesyadaddy

@hughesyadaddy hughesyadaddy commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add scripts/build_and_install.py as the shared macOS/Windows build-and-install entry point (PyInstaller build, install to platform default location).
  • Add scripts/windows_install.py to register Windows installs like a normal app: Start Menu shortcut, Apps & Features uninstall key, and an uninstall script.
  • Add a macOS install helper and VS Code build task; signing requires explicit MOUSER_SIGN_IDENTITY or MOUSER_TEAM_ID (or gitignored .env.local) — no hardcoded Apple team ID defaults.
  • Extend the VS Code default build task to run the Python entry point on Windows, macOS, and Linux.
  • Fix packaged QML on Windows: replace StackLayout sizing that left the main page blank, tighten ScrollView widths in MousePage.qml, register Qt plugin/QML library paths in main_qml.py, and log QML warnings to the app log.

Why

Windows releases ship as a portable PyInstaller folder (Mouser.exe + _internal/). Building from the repo previously had no equivalent to the macOS install helper, and the frozen Windows UI could render an empty main panel even though the sidebar loaded. This brings Windows dev install behavior in line with the official bundle layout, fixes the blank content area, and keeps signing configuration out of committed scripts.

Windows install behavior

  • Default scope: machine (C:\Program Files\Mouser) when the shell can write there; otherwise per-user (%LOCALAPPDATA%\Programs\Mouser).
  • Overrides: MOUSER_INSTALL_DIR, MOUSER_INSTALL_SCOPE=machine|user.
  • Cleanup: removes stale installs/shortcuts from the other scope before installing so duplicate Start Menu entries do not accumulate.
  • Helpers: scripts/build_and_install.bat wrapper; scripts/install_from_dist.py to install an existing dist/Mouser without rebuilding.

macOS behavior

  • scripts/build_and_install_macos_app.sh becomes a thin wrapper around the Python entry point.
  • Signing requires explicit MOUSER_SIGN_IDENTITY or MOUSER_TEAM_ID (or values from gitignored .env.local).

Test plan

  • python -m unittest tests.test_build_and_install — 12 tests pass (Windows + Linux CI).
  • Full PyInstaller build + user-scope install on Windows 11; Start Menu shortcut launches a complete bundle (1619 files under _internal).
  • Verified installed Main.qml contains pageHost layout fix; QML log no longer reports ReferenceError: s is not defined.
  • macOS: python3 scripts/build_and_install.py with signing env set — build + /Applications install.
  • Windows machine-scope install from an elevated shell.

Notes

  • Local-only QML probe tooling is gitignored (tools/probe_frozen_qml.py); not part of this PR.
  • .env.local remains gitignored for per-developer signing/install overrides.

…gration

Add scripts/build_and_install.py as the shared macOS/Windows entry point with PyInstaller build and platform-default install. Register Windows installs via Start Menu shortcut, Apps and Features uninstall key, and an uninstall script. Require explicit MOUSER_SIGN_IDENTITY or MOUSER_TEAM_ID for macOS signing with no hardcoded team defaults. Fix packaged QML on Windows (pageHost layout, ScrollView sizing, Qt plugin paths, QML warning logs). Add unit tests that pass on Linux CI.
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