Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only delete Menu when empty #218

Merged
merged 7 commits into from
Jun 6, 2024

Conversation

marcoesters
Copy link
Contributor

Description

The Menu directories are currently removed even if multiple apps share the same folder. In other words, if two apps install into the same Start Menu directory, uninstalling one of these apps will remove the entire directory. This is a regression from menuinst v1.

The same behavior happens on Linux, which doesn't appear to be the intention since _remove_this_menu() is only called if there are no additional items in the Menu. The unlinking happens regardless though.

This PR ensures that the Menu directory is only removed if the directory associated with Menu are indeed empty after all MenuItems have been removed.

I also noticed that when removing a Windows Terminal Profile via conda, the message "Could not find terminal profile for {name}.", presumably because the remove operation is executed twice. I think that message isn't helpful in either case, so I removed it here (not worth a separate PR).

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?

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label May 28, 2024
@marcoesters marcoesters marked this pull request as ready for review May 28, 2024 18:47
@marcoesters marcoesters requested a review from a team as a code owner May 28, 2024 18:47
menuinst/platforms/win.py Outdated Show resolved Hide resolved
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
@marcoesters marcoesters requested a review from jaimergp June 5, 2024 14:50
@marcoesters marcoesters merged commit 9e53a88 into conda:main Jun 6, 2024
18 checks passed
@marcoesters marcoesters deleted the windows-startmenu-directory branch June 6, 2024 14:10
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.

3 participants