chocolatey / choco

Chocolatey - the package manager for Windows
https://chocolatey.org
Other
10.05k stars 890 forks source link

Choco deleted my `oh-my-posh` installation whilst uninstalling `neovim 0.9.5` #3400

Closed m-ikiara closed 4 months ago

m-ikiara commented 4 months ago

Checklist

What Are You Seeing?

So while uninstalling Neovim installed via choco, I found that my JanDeDobbeleer.OhMyPosh installed via winget got deleted. "Mysteriously".

What is Expected?

  1. The uninstallation scripts run by choco should not fail.
  2. choco should uninstall Neovim without affecting my other installed packages.
  3. choco is a different package manager from scoop, apt-cyg and winget.

How Did You Get This To Happen?

  1. Ran choco uninstall neovim,
  2. Saw a warning that one of the uninstall scripts .ps1 failed,
  3. Noticed that oh-my-posh got "mysteriously" deleted,
  4. Restarted my computer,
  5. Listed all existing packages installed via winget. Confirmed oh-my-posh missing,
  6. Listed all existing packages installed via choco and confirmed neovim was uninstalled,
  7. Reinstalled oh-my-posh and confirmed no other package was "mysteriously" deleted.

System Details

Installed Packages

chocolatey 2.2.2
chocolatey-compatibility.extension 1.0.0
chocolatey-core.extension 1.4.0
chocolatey-windowsupdate.extension 1.0.5
KB2919355 1.0.20160915
KB2919442 1.0.20160915
KB2999226 1.0.20181019
KB3033929 1.0.5
KB3035131 1.0.3
openjdk 21.0.2
php 8.3.2
vcredist140 14.38.33135
vcredist2015 14.0.24215.20170201

Output Log

I've created a Gist containing the following files:

  1. chocolatey.log
  2. choco.summary.log

Additional Context

I found my nvim, installed via choco, had a VirusTotal score of 1/76 from 5th Feb. I can also confirm that it wasn't a false positive. I decided to uninstall it, and the above happened. What puzzles me is why Chocolatey would interfere with packages installed by a different package manager, WinGet. This is concerning! I hope this issue is resolved and will help develop this robust package manager! Cheerio!

pauby commented 4 months ago

Can you go back and remove all emojis from your issue? They are not necessary and distract from the issue.

Can you please also amend the title of the issue to be what the problem is?

Can you also provide all the logs requested by the issue template, by amending the original comment and adding them in? Please don't add them as a separate comment.

Without this, we will be unable to look further at the issue.

m-ikiara commented 4 months ago

Hello there, At least I got a response from a human! Sorry for all that earlier. I believe that the instructions stated that I could add a link to a Gist instead of dumping them all in the issue. I hope the amendments are to your liking. Once more, I'm very sorry for all of that and blessings!

pauby commented 4 months ago

The problems appear to be that the installation of neovim was detected in the oh-my-posh folder. This can happen if two installations / uninstallations etc. are taking place at the same time (one Chocolatey CLI and one Winget in this case). When Chocolatey CLI looks to take a snapshot of the changed files and registry keys, it will see all changed entries.

When you run the uninstall of neovim the pertinent log lines are:

2024-02-19 13:16:49,652 10028 [DEBUG] -  Preparing uninstall key '"C:\Users\bigboy69\AppData\Local\Programs\oh-my-posh\unins000.exe" /SILENT' for 'Oh My Posh version 19.8.2'
2024-02-19 13:16:49,707 10028 [DEBUG] -  Uninstaller path is 'C:\Users\bigboy69\AppData\Local\Programs\oh-my-posh\unins000.exe'
2024-02-19 13:16:49,707 10028 [DEBUG] -  Installer type is 'InnoSetupInstaller'
2024-02-19 13:16:49,707 10028 [DEBUG] -  Setting up uninstall logging directory at C:\Users\bigboy69\AppData\Local\Temp\chocolatey\neovim\0.9.5
2024-02-19 13:16:49,717 10028 [DEBUG] - Attempting to create directory "C:\Users\bigboy69\AppData\Local\Temp\chocolatey\neovim".
2024-02-19 13:16:49,717 10028 [DEBUG] -  Args are '/SILENT'
2024-02-19 13:16:49,722 10028 [DEBUG] - Calling command ['"C:\Users\bigboy69\AppData\Local\Programs\oh-my-posh\unins000.exe" /SILENT']
2024-02-19 13:16:50,867 10028 [DEBUG] - Command ['"C:\Users\bigboy69\AppData\Local\Programs\oh-my-posh\unins000.exe" /SILENT'] exited with '0'

It is actually running the oh-my-posh uninstaller.

The uninstallation scripts run by choco should not fail.

If the package scripts are failing, that is a package issue and you should contact the maintainer.

choco is a different package manager from scoop, apt-cyg and winget.

Scoop is not a package manager. Winget is a manifest / software manager. apt-cyg I have no experience with. So Chocolatey CLI is different.

m-ikiara commented 4 months ago

Thanks so much for helping out with this issue. This scared me. I'll contact the Maintainer and not run into the same problem later. Till next time...