Skip to content

Conversation

@marcoesters
Copy link
Contributor

Description

menuinst can install shortcuts into user-specific or system locations, depending on whether the user is administrator or not and whether the .nonadmin file is in the target or the base prefix. If the user is administrator, .nonadmin files are ignored. Uninstalling shortcuts follows the same principle: menuinst searches for system locations if the user is administrator or if no .nonadmin files are present.

This causes an inconsistency if the user is not an administrator at installation, but an administrator at uninstallation. This is not an uncommon scenario since uninstallers may be invoked with elevated privileges by default. This causes shortcuts to be left behind.

This PR implements a heuristic for uninstallations to check user locations if:

  • The user is administrator
  • No system shortcuts have been removed
  • A .nonadmin file is present in the target or the base prefix.

Closes #341

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@github-project-automation github-project-automation bot moved this to 🆕 New in 🔎 Review Nov 24, 2025
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Nov 24, 2025
@marcoesters marcoesters marked this pull request as ready for review November 25, 2025 14:52
@marcoesters marcoesters requested a review from a team as a code owner November 25, 2025 14:52
@jaimergp
Copy link
Contributor

jaimergp commented Dec 4, 2025

Nice! You are changing the returned values so they are only returned if they actually existed and were removed. This allows to check whether something happened as an admin, and fallback to user shortcuts if the installation paths are marked as .nonadmin.

I only have a few suggestions about actually checking for files and not just existence, because otherwise the unlink calls may fail when passed a directory by accident.

Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
@marcoesters marcoesters requested a review from jaimergp December 4, 2025 16:42
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Approved in 🔎 Review Dec 5, 2025
@jaimergp jaimergp merged commit 5732b41 into conda:main Dec 5, 2025
17 checks passed
@github-project-automation github-project-automation bot moved this from ✅ Approved to 🏁 Done in 🔎 Review Dec 5, 2025
@github-project-automation github-project-automation bot moved this from Sorting ⚙️ to Done 💪🏾 in conda Roadmap and Sprint Planning Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Windows: Shortcuts of user installations not removed when uninstallation is run as administrator

3 participants