Skip to content

🔨 resolve mouse binary via DevConfig in dev and pasteAppExePath in prod#4304

Closed
guiyanakuang wants to merge 1 commit into
claude/elastic-hypatia-c325a1from
feat/issue-4303-mouse-binary-config
Closed

🔨 resolve mouse binary via DevConfig in dev and pasteAppExePath in prod#4304
guiyanakuang wants to merge 1 commit into
claude/elastic-hypatia-c325a1from
feat/issue-4303-mouse-binary-config

Conversation

@guiyanakuang
Copy link
Copy Markdown
Member

Closes #4303

Stacked on top of #4222 — please merge that first.

Summary

  • Dev: read mouse binary path from a new mouseBinaryPath key in development.properties (template updated).
  • Prod: resolve at pasteAppExePath / crosspaste-mouse[.exe], with .exe suffix appended on Windows only via new MouseDaemonBinary.binaryName(platform).
  • Resolver refactor: MouseDaemonBinary.resolve now takes a caller-supplied candidatePaths list — env-aware assembly moved into DesktopMouseModule.
  • Error message: environment-aware. Dev points at development.properties and the override env vars; prod surfaces the attempted bundled path and asks the user to reinstall.
  • Keep -Dcrosspaste.mouse.binary and $CROSSPASTE_MOUSE_BIN as per-launch / per-shell escape hatches.

Why

The old default $HOME/crosspaste-mouse/target/release/crosspaste-mouse was a developer-machine convention that breaks on Windows (Cargo emits crosspaste-mouse.exe) and had no defined production location. This change gives both environments a clear, intentional resolution path.

Test plan

  • ./gradlew app:desktopTest --tests com.crosspaste.mouse.MouseDaemonBinaryTest — 6/6 passing (includes new binaryName and candidate paths used cases).
  • ./gradlew app:compileKotlinDesktop app:compileTestKotlinDesktop — clean build.
  • ./gradlew ktlintFormat — clean.
  • Manual: run desktop app on macOS with mouseBinaryPath set in development.properties; verify mouse daemon spawns.
  • Manual: run desktop app on Windows with mouseBinaryPath set to ...crosspaste-mouse.exe; verify mouse daemon spawns.
  • Manual: launch with mouseBinaryPath empty and no env var override; verify the error message in dev mode is clear and actionable.

The previous default candidate `$HOME/crosspaste-mouse/target/release/crosspaste-mouse`
was a developer-machine convention that breaks on Windows (no `.exe` suffix)
and has no defined production location.

- Read the dev binary path from a new `mouseBinaryPath` key in
  `development.properties` (added to the tracked template).
- In production, look at `pasteAppExePath / crosspaste-mouse[.exe]` —
  add `MouseDaemonBinary.binaryName(platform)` for the `.exe` suffix.
- Move env-aware candidate assembly into the caller (`DesktopMouseModule`)
  so `MouseDaemonBinary` stays a generic resolver.
- Make the "binary not found" error environment-aware: dev points at
  `development.properties`, prod surfaces the attempted bundled path
  and tells the user to reinstall.
- Keep `-Dcrosspaste.mouse.binary` and `$CROSSPASTE_MOUSE_BIN` as
  per-launch / per-shell escape hatches.

Closes #4303
@guiyanakuang
Copy link
Copy Markdown
Member Author

Closing — this commit belongs in the broader crosspaste-mouse integration (#4222), not as a standalone PR. Moving the commit to claude/elastic-hypatia-c325a1.

@guiyanakuang guiyanakuang deleted the feat/issue-4303-mouse-binary-config branch April 26, 2026 11:01
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