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

Consider when the user Cancels the SDK Installer on Mac #1993

Merged
merged 4 commits into from
Oct 16, 2024

Conversation

nagilson
Copy link
Member

@nagilson nagilson commented Oct 16, 2024

Resolves #1572

Background

When installing via Mac, our biggest failure right now is 'Validation of Installation' failed. This is because we use open which returns 0 even if someone closes the installer, cancels the installation, or fails the password prompt in the .NET installer, so we assume it has succeeded and then check to make sure .NET was installed and fail because it was not

We could
A - Assume that someone cancelled if the install isnt there and open on the installer returned 0
B - Move to sudo installer -pkg Path -target LocalSystem

Unfortunately to use installer you need to use sudo first so we need to use this joyous password prompt every single time if we do that:

image

I consulted our PM to decide how to handle this and he suggested:

we could pop up a question notification? "hey, it looks like SDK installation failed - would you like to retry the installation? Y/N/Shut up and go away forever"

I started the implementation of this but it is very ugly and the telemetry logic/counting of where we are in the install gets jank and it would take a lot of effort. In addition, we would want a 'yes' and 'no' button with distinct categories to solve what we are trying to solve -- yes, I want to retry and I had cancelled it; yes, I want to retry because it failed; no with either or the above.

So what I decided to do:

What's in the PR

When the Mac installation for SDKs fails but the installer returned 0, we add a message asking the user if they had cancelled the installation request, and if so and they want the SDK to be installed, to please try again.

Consider that to tell if the user wanted to say 'no' or 'yes' to retry, that doesnt indicate whether they meant to do the install or not. We would then need more options to tell if we actually failed or not. I dont want to rely on this and I dont think it is a high enough priority with the complexity required to reroute the code to add a retry button that does a certain retry depending on if someone clicked to cancel the install on mac
@@ -3,6 +3,7 @@
* The .NET Foundation licenses this file to you under the MIT license.
*--------------------------------------------------------------------------------------------*/

import { IDotnetAcquireContext, IVSCodeExtensionContext } from '..';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer needed, thank you, I will remove this in a upcoming change

catch(error : any) // fs.readdirsync throws ENOENT so we need to recall the function
{
this.assertOrThrowError(failOnErr, false,
`${dotnetValidationFailed} The dotnet file dne "${dotnetPath}"`, install, dotnetPath);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dne?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not exist

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should be more clear with these messages, good point

@nagilson nagilson merged commit 13e2bf6 into dotnet:main Oct 16, 2024
9 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
2 participants