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

Allow uninstallation of global .NET Installations #1897

Merged
merged 58 commits into from
Aug 15, 2024

Conversation

nagilson
Copy link
Member

@nagilson nagilson commented Jul 30, 2024

Global Uninstall

Allows uninstall of global .NET SDKs.

For windows, use /uninstall flag on the installer.
For mac, use sudo rm rf as /uninstall flag DNE on mac
For linux, use apt-get remove. (pre-existing code with pre-existing tests)

Other Code Changes

  • These are needed to make uninstall work successfully

Sets a DEBIANT_FRONTEND environment variable temporarily in the shell script process to prevent apt-get remove from trying to grab stdin which may be busy.

Adds an exit.txt variable to tell the master sudo process to die. Sometimes this process will hold onto the lock after install/uninstall and then this causes problems. Resolves #1904

Adds -rf to the final process trap exit to prevent failure due to file DNE if it's already been cleaned up before the process dies.

Adds pre-existing images which used to be ignored for some reason.

Uses VS Code Icon Pack to be compliant with iconography restrictions and also keep icons updated per API instead of trying to invoke win-32 API to get the UAC icon.

Increase DPKG lock timeout to 180 seconds as it can sometimes take longer.

Adds -y to some commands which may be necessary with DEBIAN_FRONTEND.

UI

Adds a UI to uninstall a local or global .NET installation from the user.

Base command:
image

Picking an installation:
image

Has warning menu if you try to uninstall a .NET version which will break an extension which relies on that installation.
image

Uninstall Experience

Windows, non-elevated:
image

This output window appears. If not-elevated, UAC prompt will appear, no further intervention is required.

image
(this text is old, it now just says uninstalled)

Mac:
Password prompt will appear to elevate to uninstall.
image

Linux:
image

If no installs exist:
Context menu will show no installs.
image

nagilson and others added 29 commits July 15, 2024 14:38
This is now what is hitting the EPERM and ENOENT errors.
We need to skip the check and see what happens from here, such as allowing to elevate via windows.

This also adds specific handlers for when we fail to download the SDK.
Need to double check that cancelling is handled properly now that its a promise reject
we need to fix the uninstallglobal functoin logic to print out and such still
then test it
@nagilson nagilson marked this pull request as ready for review August 13, 2024 18:35
@nagilson nagilson requested review from a team, MiYanni and smitpatel August 13, 2024 18:57
@nagilson nagilson enabled auto-merge (squash) August 15, 2024 22:08
@nagilson nagilson merged commit 8bc2ecf into dotnet:main Aug 15, 2024
7 checks passed
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.

We should pkill the master process on install completion
2 participants