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

Put an item into the Add / Remove Programs directory #1618

Closed
notriddle opened this issue Jan 20, 2019 · 11 comments · Fixed by #2670
Closed

Put an item into the Add / Remove Programs directory #1618

notriddle opened this issue Jan 20, 2019 · 11 comments · Fixed by #2670

Comments

@notriddle
Copy link

notriddle commented Jan 20, 2019

It doesn't seem right that people should be stuck not knowing how to uninstall rustup. If you really want to make someone feel like they don't have control of their computer, make it so that when they fail to get started with Rust, they don't even know how to put things back the way they were.

It should be possible to integrate rustup with the Windows software manager.

@ashthespy
Copy link

ashthespy commented Jan 20, 2019

Not to disregard the issue, but doesn't rustup self uninstall get rid of Rust on Windows quite painlessly?

@notriddle
Copy link
Author

Only if you know how to use a CLI. You don't need to use a CLI to get it installed (alright; technically you get a console window when you install it, but you don't actually need to know how to open a command line since it'll just open it when you double-click the installer).

@retep998
Copy link
Member

retep998 commented Jan 21, 2019

A registry key must be added under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall with the appropriate information. Section 6 on this MSDN article covers what should go into that registry key, or just look at existing examples under that path in the registry.

Because people would run the uninstaller from a GUI, it would be best to have a graphical version of rustup self uninstall which brings up a message box to confirm the user wants to uninstall rustup, and another message box when the operation is complete.

If anyone wants to tackle this, I am available to answer any questions regarding implementation.

@NathanFrasier
Copy link

I'd like to try my hand at this, if no-one else has volunteered. I can take a closer look and try to dig into the documentation and code next week.

@kinnison
Copy link
Contributor

You're welcome to try and sort this, thank you :D If you want to discuss things, please pop onto the Discord server and talk to us in #wg-rustup

@NathanFrasier
Copy link

Found more up to date documentation on the registry keys involved: https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key
Looks like some key names have changed since 2006, do we have a specific backwards compatibility target for windows? If so, that informs my testing for what registry keys we need.

@retep998
Copy link
Member

Rust has a minimum host requirement of Windows 7 (it can target farther back than that), so that is as far back as you'd have to test anything.

@kinnison
Copy link
Contributor

Rustup is clearly uninterested in running on anything which rustc cannot run on; so Windows 7 is the oldest we care about from this perspective.

@kellda
Copy link
Contributor

kellda commented Feb 11, 2021

I'm interested to work on this. The bare minimum seems to be:

  • Create a new key under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall (officially an GUID, many apps just use their name)
  • Add a DisplayName string (is it better to display it as "rustup", "Rust" or something else ?)
  • Add a UninstallString which is the path to the uninstaller (i.e. cargo_home\bin\rustup.exe self uninstall)

Once this works, one could add more keys, e.g. the version, the publisher or a logo.

I don't thing a GUI is more needed to the uninstaller than the installer, is the confirmation message rustup already shows enough ?
image

@kinnison
Copy link
Contributor

Sounds good, I look forward to your patch.

@kellda
Copy link
Contributor

kellda commented Feb 17, 2021

I eventually got some time to try to implement this, but I realize I'm not sure where to put that code. I think in cli/self_update/windows.rs in a new function. But then from where should it be called ? do_add_to_path ? Or cli::self_update_install ? Also, should it be gated by the no_modify_path option or a new one ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants