Skip to content

feat: list and uninstall Windows apps with raven env apps and raven env uninstall - #70

Merged
MotherSphere merged 3 commits into
Project-Colony:mainfrom
ghahramani:feat/env-apps-uninstall
Dec 1, 2026
Merged

MotherSphere merged 3 commits into
Project-Colony:mainfrom
ghahramani:feat/env-apps-uninstall

Conversation

@ghahramani

Copy link
Copy Markdown
Contributor

Note: Built on top of #69 (feat/env-open) for Environment::open_or_active. Review the second commit (0b3c293) for this PR's changes.

Summary

Adds raven env apps and raven env uninstall so users can list Windows programs registered in an environment and run their registered uninstallers (cleaning up both files and registry entries):

  • raven env apps [name] [--all]: reads Uninstall keys from system.reg (HKLM, including Wow6432Node) and user.reg (HKCU), decoding strings, str(1)/str(2), dword, and multi-line UTF-16LE hex(1)/hex(2) values. Filters out SystemComponent=1, ParentKeyName, NoRemove=1, and entries with no uninstaller unless --all is passed.
  • raven env uninstall <app> [--env <name>] [--quiet] [--remove-entry]:
    • Matches by exact case-insensitive name/key or unique substring (preferring user-facing apps over hidden system components).
    • Parses quoted and unquoted .exe uninstall command lines, rewrites MsiExec.exe /I{...} to /X{...} (adding /qn with --quiet), handles %VAR% via cmd /c, checks that C:\... uninstaller binaries exist, and runs the uninstaller inside the environment's session via raven run.
    • When --remove-entry is given (e.g. for stale entries whose uninstaller is already missing), deletes the Uninstall key offline from system.reg/user.reg while stopped or via wine reg delete while running.
  • Docs, i18n, and tests: adds English/French help, messages, and errors, updates README.md and docs/guide/usage.md, and adds unit + CLI integration tests.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --locked (all 260 workspace tests passed)

ghahramani and others added 3 commits December 1, 2026 13:40
…n env uninstall`

Adds `raven env apps [name] [--all]` to list Windows applications registered under `Uninstall` in `system.reg` (`HKLM`, including `Wow6432Node`) and `user.reg` (`HKCU`), hiding system components, sub-updates, and non-removable entries by default.

Adds `raven env uninstall <app> [--env <name>] [--quiet] [--remove-entry]` to resolve a registered app by exact name/key or unique substring and run its Windows uninstaller inside the environment's session via `raven run`, removing both files and registry entries. When an uninstaller binary is already missing on disk, `--remove-entry` removes the stale `Uninstall` registry entry directly (offline when stopped, or via `wine reg delete` while a session is running).
`raven env apps` and `raven env uninstall` now run `wine uninstaller
--list` and `--remove <key>` inside the environment instead of reading and
editing system.reg and user.reg themselves.

Wine's uninstaller reads the same Uninstall keys under HKLM, its 32-bit
view and HKCU, leaves out system components, and runs the command a
program registered, or `msiexec /x{key}` for a Windows Installer one.
Going through it removes what the offline reader got wrong: Wine's \x
escapes were not decoded, so a name with an accent no longer matched and
its entry was reported stale; a quoted %VAR% command failed under
`cmd /c`; any `/I...` argument was rewritten to `/X...`; the files were
read while the session's wineserver could still hold newer data; and
`--remove-entry` edited them by hand. When an uninstaller is gone, Wine
offers to take the program off the list, which replaces --remove-entry.

- `raven env apps [name]` prints each program's name and key. A stopped
  environment's session is started for it and stopped again afterwards.
  The list is written to a file, not a pipe: Wine's services started by
  the first program of a session would hold a pipe open.
- `raven env uninstall <name> <app>` takes the environment first, as the
  other env subcommands do, and the program by key, exact name or a part
  of a name no other program has. --quiet and --remove-entry go: no
  uninstaller is reliably silent, and the stale case is Wine's dialog.
- Names are printed with control characters replaced.

Tried on a real environment: the list matched what Wine registered, and
uninstalling a test entry whose UninstallString deletes its own key ran it
and removed it from the list. 254 tests.
- Wine prints `uninstaller --list` in code page 1252, and stops a line at
  a character 1252 has no match for, gluing the next entry onto it. Only
  the last two fields of a line are taken now, so such a program is left
  out instead of lending its key to the next one. 0x80 to 0x9F are read
  as 1252's characters (’ – ™ €), not Latin-1's control characters, and
  names have control characters replaced before they are printed.
- A key listed twice (HKLM and HKCU) counts as one program, the first Wine
  lists with it, which is the one `--remove` runs.
- When `raven run` cannot start, its own message is part of the error
  instead of only an exit status.
- A listing stops the session it started only if nothing of the user's
  joined it meanwhile.
- `--remove-entry` is back, through `wine reg delete` in the environment,
  for HKLM, its 32-bit view and HKCU: Wine 11's uninstaller asks whether to
  take a program whose uninstaller is gone off the list, but deletes the
  key through a handle it has already closed, so the answer changes
  nothing.
- Help and guide say most uninstallers ask before removing anything, not
  that all do.

Tried on a real environment: an HKCU entry pointing at a missing
uninstaller was listed, then taken off the list. 256 tests.
@MotherSphere
MotherSphere force-pushed the feat/env-apps-uninstall branch from 0b3c293 to 01a9f4a Compare December 1, 2026 12:41
@MotherSphere
MotherSphere merged commit a510e06 into Project-Colony:main Dec 1, 2026
3 checks passed
@MotherSphere

Copy link
Copy Markdown
Member

Thank you for this, it covers something people will need. It's merged in a510e06 and shipped in v0.8.0, in a different shape from the one you sent, so here is the reasoning.

Wine already ships an uninstaller that reads the same Uninstall keys and runs the same commands: --list, --remove <key>, and msiexec /x{key} for Windows Installer entries. raven env apps and raven env uninstall now call it through raven run. Reading the .reg files directly ran into things that are hard to get right outside Wine: its \x escapes for non-ASCII names, %VAR% command lines under cmd /c, and files that a running session's wineserver only writes out now and then.

--remove-entry stayed, now through wine reg delete. Wine 11's uninstaller does offer to remove an entry whose uninstaller is gone, but it deletes the key through a handle it has already closed, so answering yes changes nothing.

The matching rules are yours: a key, an exact name, or a part of a name no other program has.

@ghahramani

Copy link
Copy Markdown
Contributor Author

Thank you for this, it covers something people will need. It's merged in a510e06 and shipped in v0.8.0, in a different shape from the one you sent, so here is the reasoning.

Wine already ships an uninstaller that reads the same Uninstall keys and runs the same commands: --list, --remove <key>, and msiexec /x{key} for Windows Installer entries. raven env apps and raven env uninstall now call it through raven run. Reading the .reg files directly ran into things that are hard to get right outside Wine: its \x escapes for non-ASCII names, %VAR% command lines under cmd /c, and files that a running session's wineserver only writes out now and then.

--remove-entry stayed, now through wine reg delete. Wine 11's uninstaller does offer to remove an entry whose uninstaller is gone, but it deletes the key through a handle it has already closed, so answering yes changes nothing.

The matching rules are yours: a key, an exact name, or a part of a name no other program has.

My pleasure! That's wonderful. I wasn't aware that Wine had this option, and your solution is definitely cleaner.

Just one thing to bear in mind: in my experience, some Windows applications are installed without an uninstaller. That's why I included the "Remove Entry Only" option as a fallback, so that even if an uninstaller isn't available, the corresponding registry entries can still be removed.

I genuinely love your product, and it has become my daily driver. The fact that I can use Windows applications just like native Linux applications, with such seamless integration, is fantastic.

Thank you so much for creating such a great product and for all the hard work you've put into it!

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.

2 participants