Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

[Bug] scoop uninstall scoop - He deleted something that was not within his competence. #5726

Closed
alexeyp0708 opened this issue Nov 10, 2023 · 12 comments
Labels

Comments

@alexeyp0708
Copy link

alexeyp0708 commented Nov 10, 2023

According to this issue #249
I changed the installation location via [environment]::setEnvironmentVariable('SCOOP','Z:\usr','User')
Next I installed SCOOP
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iex
After installation, I realized that the installer for SCOOP does not create a separate folder and created all the working folders in the current directory (Z:\usr)
I decided to remove SCOOP
scoop uninstall scoop
As a result, all files and folders in Z:\usr began to be deleted.
He deleting until he threw an error on the blocked file.
Now I don’t know what exactly was deleted from me.
I don't know how to restore files now.
I'm shocked. I hoped that it would delete safely without affecting files in the current directory and would delete exactly those folders that it had installed.
there were no warnings that the deletion would also affect third-party files

Complete shit.

@alexeyp0708
Copy link
Author

alexeyp0708 commented Nov 10, 2023

Recovered files via r-studio.
But not everything was restored. Unfortunately, there are executable scripts that cannot be restored and they were in a single copy.
A lot of time was spent on these scripts. And for your unthought-out decisions I am in the ASS.
This behavior is walking a fine line.
Please correct and remove the component safely. (create a registry of component files during installation, and delete only them. If the folder is not empty, then complete the removal and notify about it)

@HUMORCE
Copy link
Member

HUMORCE commented Dec 29, 2023

Losing files can be frustrating, but this is a human error, not a bug.

Scoop considers Z:\usr as its root directory and 'competence scope', when you set the environment variable.

Although the guide in #249 was published in 2014, but it still applies to the current version of Scoop, and it contains a backup step.

Related:

@HUMORCE HUMORCE closed this as completed Dec 29, 2023
@alexeyp0708
Copy link
Author

alexeyp0708 commented Dec 30, 2023

@HUMORCE

Remove-Item $appdir -Recurse -Force -ErrorAction Stop

If you think that forced deletion of a directory, without regard to the human factor, is good, then planes will crash more often with such programmers.

The user should not worry that something is wrong with your installation or uninstallation.
The first rule of any program is do no harm.

If you implement the code correctly, then when deleting you need a registry of installed directories and files and deletion according to this registry.
Or another option - when installing in a non-empty directory, throw an error and stop the installation.
But you will be too lazy to correct such a potentially serious mistake. Let someone else face this problem sooner or later.

@alexeyp0708
Copy link
Author

Also, this behavior is a tasty morsel for malware,
Just change the SCOOP environment variable,
and subsequently by running "uninstall.ps1" another directory with all its contents will be deleted.

@HUMORCE
Copy link
Member

HUMORCE commented Dec 30, 2023

Also, this behavior is a tasty morsel for malware,

Malicious can do better without this in fact.

Or another option - when installing in a non-empty directory, throw an error and stop the installation.

That's good and enough. tracking files is not a good idea.


However, I would still identify the entire process of your missing files as Human error. you are installing Scoop with the advanced/unrecommended way in first time installation.

@HUMORCE HUMORCE reopened this Dec 30, 2023
@HUMORCE
Copy link
Member

HUMORCE commented Dec 31, 2023

The suggestion for non-empty directory check was added to the ScoopInstaller/Install#60

For consistency, we should prompting more information when executing scoop uninstall scoop.

@alexeyp0708
Copy link
Author

alexeyp0708 commented Jan 10, 2024

However, I would still identify the entire process of your missing files as Human error. you are installing Scoop with the advanced/unrecommended way in first time installation.

@HUMORCE
I agree with you that this is a human error. But human errors are caused by the imperfection of the system. The system must exclude such fatal errors.
In my case, my entire development environment is on a separate disk and is not tied to a specific computer.
In your installation, to change the installation path, you have to change the SCOOP variable.
Personally, I thought that when installing, your program takes care of the fact that it will create its own directory. And the SCOOP variable is needed to indicate the parent directory. For example, like in Windows - ProgramFiles directory or User/AppData directory.
But everything didn't go according to plan.
I still have to sort out this problem (my files deleted with an uninstallation script). Since this script affected many directories.

When installing, you can simply check for an empty directory. if the directory is empty, then install it into it, otherwise create your own scoop directory. Or should you always create your own empty directory.

In this commentary, I expressed additional information and opinion that may help eliminate human error in the future.

Thank you for your attention.

@HUMORCE
Copy link
Member

HUMORCE commented Jan 10, 2024

the SCOOP variable is needed to indicate the parent directory. For example, like in Windows - ProgramFiles directory or User/AppData directory.

$env:SCOOP for set the Scoop Root Direcotry, like:

⭕️ $JAVA_HOME = ~/java/openjdk11
❌ $JAVA_HOME = ~/java

⭕️ $GOPATH = ~/go
❌ $GOPATH = ~

etc.

That's why I think it's a human error. I have not meet a situation where an environment variable is pointed to a parent directory, which may appear in the installation wizard of some programs:

Selected: c/programs/ , then actual install to: c/programs/app

@alexeyp0708
Copy link
Author

alexeyp0708 commented Jan 10, 2024

$env:SCOOP for set the Scoop Root Direcotry, like:

Please indicate where this is in the documentation where your environment variables are described.

You must understand that everyone has their own intuition and experience in using programs. The program should not cause harm even if a human error occurs.ё

@HUMORCE
Copy link
Member

HUMORCE commented Jan 10, 2024

Please indicate where this is in the documentation where your environment variables are described.

If you follow the installation guide, you will see the name of the parameter as -ScoopDir: https://github.com/ScoopInstaller/Install?tab=readme-ov-file#advanced-installation

You must understand that everyone has their own intuition and experience in using programs. The program should not cause harm even if a human error occurs.ё

Of course, I know and I could not believe the mistake was made by you when I noticed you were using *nix-like directory structure in Windows.


There's no point in arguing this now.

Your issue has been tracked, once it is improved,THIS issue will not occur again. But what about the others? We must be vigilant when trying new things.

@alexeyp0708
Copy link
Author

alexeyp0708 commented Jan 10, 2024

Please indicate where this is in the documentation where your environment variables are described.

I'm sorry. I found it in the description on the README.md page in ScoopInstaller/Install.

The installation information is divided into different parts (https://scoop.sh/ , https://github.com/ScoopInstaller/Scoop , ScoopInstaller/Install, so I was not able to read it in time. I only got acquainted with https://scoop.sh/. Where there were no additional details.
I needed to install the required package according to someone else's instructions, but in a specific directory. I didn’t care about additional one-time information at that time.

@alexeyp0708
Copy link
Author

alexeyp0708 commented Jan 10, 2024

Of course, I know and I could not believe the mistake was made by you when I noticed you were using *nix-like directory structure in Windows.

I'll tell you how it happened.

  • I set the environment variable [environment]::setEnvironmentVariable('SCOOP','Z:\usr','User').
  • Installed scoop according to your instructions https://scoop.sh/
  • scoop directories are mixed with my directories, of which there are many.
  • I realized that I set the SCOOP environment variable incorrectly
  • I decided to delete the SCOOP application, because I didn’t understand which directories were superfluous. And I hoped that the application knew what it was deleting. In my experience, such cases were not isolated and no problems arose (Not a single application forcibly deleted all user files in a directory). And for “nix” systems without any access rights at all, you can’t simply delete unnecessary things .
  • my fatal surprise

@ScoopInstaller ScoopInstaller locked and limited conversation to collaborators Apr 11, 2024
@rashil2000 rashil2000 converted this issue into discussion #5881 Apr 11, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants