Repository navigation
Desktop app follow-ups: uninstall, licences, install.sh, setup start - #6
Merged
Merged
Conversation
The window and tray locks and ports go into craft-cloud-app, next to the agent's data folder, instead of loose in the per-user data folder. Both uninstallers remove that folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
As the Windows setup's --no-start-menu: no entry is written, and one an earlier install made is removed. An unknown option exits 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
When the wait for a busy agent runs out, the agent has already accepted the quit and stops after its pass. Starting it at once did nothing (the old one still ran), and without a systemd unit nothing started it at all. Now a background step waits until it stops answering and has let go of its data folder, then starts it again: through systemd when it has a unit, else `run --log`. The upgrade without a unit waits the same way, so the new copy doesn't find the folder still taken and exit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
Without dbus-daemon the tray tests returned early and passed, silently. The skip is now written to stderr past the test capture, and with CRAFT_CLOUD_REQUIRE_BACKENDS set it is a failure, as for the server's backends. CI installs dbus on Linux and runs the tray tests again with the variable set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
A failed RegisterStatusNotifierItem, at start or when the tray restarts, was dropped without a word. It is now said on stderr, as the app's other troubles are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
An I/O error once the agent was stopped (a file that can't be written, the setup's own exe that can't be read) ended the install with the agent left stopped until the next login. Now it is started again, from the folder its start at login names, and the error says whether that worked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
An agent counted as gone whenever tasklist couldn't run or failed, so the setup could carry on while the agent still held its files. Only an answer counts now: a tasklist that can't run, fails or prints nothing stops the install or uninstall before anything changes, as an agent that won't stop does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
The agent was spawned straight from the setup, so it inherited every inheritable handle, among them the setup's output when that is a pipe. Run from WSL or a script, the setup then never seemed to end: the pipe stayed open as long as the agent ran. std can't turn inheritance off on stable Rust without unsafe, so Windows' shell starts the agent now (PowerShell's Start-Process), which hands it nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
Uninstalling from "Apps & features" scheduled the folder's removal for three seconds later, while the setup still showed its last message and so still held its own exe: rmdir failed and the folder stayed for good. The removal now waits for the setup's process to end, then deletes the folder, trying again for a while if a file is still held. The path goes in as an environment variable, so nothing in it is read as a command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
The app builds in egui's default fonts (Ubuntu Font Licence, OFL-1.1, MIT), whose licences ask for their text to go with every copy, and no package carried any licence. cargo xtask package now writes LICENSES.txt: Craft Cloud's NOTICE, LICENSE-MIT and LICENSE-APACHE, the font licences from epaint_default_fonts and the Boost licence of clipboard-win, error-code and xxhash-rust, read from the crates cargo fetched. It goes in the tarball (install.sh installs it next to the programs), the macOS bundle's Resources and the Windows setup's payload. NOTICE says what is bundled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
…g it again The local API goes away a few seconds before the agent lets go of its data folder, and an agent started in between exits 0, which nothing restarts. The script now reads the pid from local-api.json before the quit and waits for that process to end (kill -0) within the same limit. With the unit, `systemctl --user stop` then `start` replaces the plain restart. On a timeout nothing changes, and a background step starts the agent once its process has ended, from the unit or the installed copy, never the unpacked package. A failure after the stop (e.g. a failed copy) starts the agent again from an EXIT trap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
Once the agent has accepted the quit, a tasklist that fails gave "Nothing was changed" and left the agent stopping, with nothing to start it again. tasklist is now asked a few more times; if it still can't tell, the stop is Unknown (not StillRunning) and the install and the uninstall start the agent again from the folder its Run value names before they report. A tasklist failure before the quit still refuses the run, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
- tasklist, taskkill, cmd and PowerShell are run from %SystemRoot%\System32: a bare name is looked for next to the setup first. - Starting the agent: when PowerShell fails or exits non-zero, the agent is spawned directly (it then shares the setup's handles, but runs); the way taken is printed. - The uninstall's delete: PowerShell waits for the setup's process, then cmd's rmdir /s /q removes the folder (Start-Process works in constrained language mode; no .NET call). Where PowerShell can't run, cmd alone waits with tasklist, then removes it. rmdir /s removes a junction without following it. The Uninstall key goes only once one of them was started. The remover works in the folder above, not inside it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
LICENSES.txt was a hand list of a few texts. It is now generated from cargo tree (normal dependencies of the packaged programs for this target, no proc-macros) and cargo metadata: every third-party crate by name and version, with its licence expression and each licence, notice and copying file it ships (a text already given is named, not repeated), and for MPL-2.0 crates where their unmodified source is. A crate with no such file passes only when it can be taken under plain MIT or Apache-2.0 (clipboard-win gets error-code's BSL-1.0 text); any other fails the package, by name. Line ends are normalised, so every OS writes the same text. A test checks that every crate the licence gate excepts that is in the programs is in the real file. xtask now uses serde_json (in the lock). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
… effort Both uninstallers removed the derived craft-cloud-app folder recursively, which would wipe a folder of the same name beside a custom agent folder, and the setup failed the uninstall when a file there was still held. Now only the app's own file names go, the folder only once empty, after the Uninstall key, and a failure there is ignored. The loose files older versions kept beside the folder go too. uninstall.sh ignores a relative XDG_DATA_HOME, as the app does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
- The refused-tray test reads what register says, not only that it fails. - The setup test for "nothing to start" really has nothing to start, and checks that this is said. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz
Owner
Author
|
Tried on the two test machines at 80aab5f:
Not tried: uninstalling from Apps & features, and the cmd fallbacks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups from the desktop app PR (#5): its "Left for later" list and the review notes, plus one round of fixes from this PR's review.
What changed
rmdir /s /qremoves the program folder. PowerShell waits for the process; where PowerShell can't run,cmdalone waits usingtasklist.rmdir /sremoves a junction without following it. The Uninstall key is removed only once one of the two has been started.LICENSES.txtis generated fromcargo treeandcargo metadatafor every third-party crate compiled into the shipped programs (normal deps for the target, no proc-macros), sorted by name and version. Each crate gets its licence expression and the licence/notice/copying files it ships. MPL-2.0 crates get a line pointing at their unmodified source on crates.io.install.sh --no-menu: leaves out the app menu entry and removes one an earlier install made.Start-Process, so it inherits none of the setup's handles, and a setup run from a pipe (WSL) returns. If PowerShell fails, the agent is spawned directly, and the setup says which way it took. System tools are called by full path from%SystemRoot%\System32.craft-cloud-app/, next to the agent's data folder. The uninstallers remove only the app's own file names (and the old loose ones), then the folder once it is empty, best effort, as the last step.CRAFT_CLOUD_REQUIRE_BACKENDSset, a skip fails. CI installsdbusand runs them with it set. AGENTS.md says so.install.shand the running agent: it reads the agent's pid fromlocal-api.json, asks it to quit, then waits for the process to end (kill -0) withinCRAFT_CLOUD_INSTALL_WAIT. Only then does it change anything.systemctl --user stopthenstart, orrun --logwithout a unit.tasklistthat fails or prints nothing doesn't count as the agent having ended. If it fails after the agent acceptedquit, the setup starts the agent again before reporting. An install that fails after the stop does the same.Testing
Linux:
cargo xtask cipasses (856 passed, 0 failed, 1 ignored). The install.sh tests cover the upgrade with and without a unit, the timeout with and without one, a failure after the stop, and--no-menu. They run against stand-ins whose agent process is a realsleepnamed inlocal-api.json.cargo xtask packagebuilds the tarball, and its LICENSES.txt lists 361 crates.Windows: clippy
--all-targets -D warningsand the tests pass for the desktop, setup and xtask crates. Windows-only tests cover:cmd) wait for the process, then remove a folder with&in its name and a junction inside it, without following the junction.cargo xtask packagebuilds the setup with LICENSES.txt in it. The setup and the app weren't run on this machine.On this Windows (German),
tasklist's "no tasks" line goes to stdout, so an empty answer really is a failure.Left
KillUserProcesses=yes. It could run undersystemd-run --user.[or](wildcards); the direct-spawn fallback then starts it.🤖 Generated with Claude Code
https://claude.ai/code/session_01RC1oqfy9kZznj94RjMojyz