conda / menuinst

Cross platform menu item installation
https://conda.github.io/menuinst/
BSD 3-Clause "New" or "Revised" License
37 stars 44 forks source link

Document how to uninstall (i.e. "remove") shortcuts #236

Open jypeter opened 3 months ago

jypeter commented 3 months ago

Checklist

What happened?

It took me some time to find out how to uninstall shortcuts without having to manually remove them from C:\Users\my_login\AppData\Roaming\Microsoft\Windows\Start Menu\Programs, on Windows

I created a json file with the turtle Minimal example and I successfully installed the shortcuts using $ python -c "from menuinst.api import install; install('./turtle.json')", as described in Usage

I then tried to uninstall this but

This can probably be added very easily to the documentation

It would also be useful to be able to remove a menu by just giving the menu name (instead of the json file that you may have lost), but I understand it would not be very safe, on probably would not remove the shortcuts on the desktop

Additional Context

No response

jypeter commented 3 months ago

It is also useful (for understanding a bit how menuinst works, and for debugging purpose) to display the paths of the generated/removed links

You could kill 2 birds with one stone by adding a Verbose Usage section with an example at the end of the Getting started page. Or something similar. Or put this in a FAQ

The example below installs and then removes the turtle minimal example

(base) PS C:\Users\jypeter\menuinst_test> python -c "from menuinst.api import install, remove; import pprint; pth_list = install('./turtle_original.json'); pprint.pprint(pth_list)"
[WindowsPath('C:/Users/jypeter/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Python N.A'),
 WindowsPath('C:/Users/jypeter/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Python N.A/Launch Turtle.lnk'),
 WindowsPath('C:/Users/jypeter/Desktop/Launch Turtle.lnk'),
 WindowsPath('C:/Users/jypeter/AppData/Roaming/Microsoft/Internet Explorer/Quick Launch/Launch Turtle.lnk'),
 WindowsPath('C:/Utils/miniconda3_2024-03/Menu/Launch Turtle.bat')]

(base) PS C:\Users\jypeter\menuinst_test> python -c "from menuinst.api import install, remove; import pprint; pth_list = remove('./turtle_original.json'); pprint.pprint(pth_list)"
[WindowsPath('C:/Users/jypeter/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Python N.A/Launch Turtle.lnk'),
 WindowsPath('C:/Users/jypeter/Desktop/Launch Turtle.lnk'),
 WindowsPath('C:/Users/jypeter/AppData/Roaming/Microsoft/Internet Explorer/Quick Launch/Launch Turtle.lnk'),
 WindowsPath('C:/Utils/miniconda3_2024-03/Menu/Launch Turtle.bat'),
 WindowsPath('C:/Users/jypeter/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Python N.A')]