altair icon indicating copy to clipboard operation
altair copied to clipboard

[BUG] Chocolatey package leaves old version shims

Open Destroy666x opened this issue 1 year ago • 4 comments

Describe the bug The Chocolatey package leaves old version shims in C:\ProgramData\chocolatey\bin

To Reproduce Steps to reproduce the behavior:

  1. Install with choco
  2. Update with choco
  3. Check C:\ProgramData\chocolatey\bin - multiple exes will be there

Expected behavior Only one executable in that dir, preferably without version.

Desktop (please complete the following information):

  • OS: Windows
  • Browser: -
  • Platform: choco
  • Version: any

Destroy666x avatar Apr 13 '23 16:04 Destroy666x

Hey, thanks for raising the issue. Unfortunately I don't know what we need to change to avoid this behavior. I'm open to hear if there's a solution for this though.

Disclaimer: I don't use a windows machine so I haven't experienced this, and have no idea how to even go about it.

imolorhe avatar Apr 23 '23 18:04 imolorhe

https://docs.chocolatey.org/en-us/features/shim should help. It seems that the installer is shimmed. Perhaps using Install-ChocolateyInstallPackage instead of Install-ChocolateyPackage is the solution, but I'm not Chocolate expert either.

Destroy666x avatar Apr 24 '23 08:04 Destroy666x

For referrences:

https://docs.chocolatey.org/en-us/create/functions/install-chocolateyinstallpackage#inputs https://docs.chocolatey.org/en-us/create/functions/install-chocolateypackage

imolorhe avatar Apr 29 '23 04:04 imolorhe

@imolorhe actually, that's not the problem.

Shims aren't documented too well IMO, but here's what happens:

  • you're downloading installer to chocolatey\lib\altair-graphql kind of folder in chocolateyInstall.ps1
  • you're not deleting that installer after it finishes the job
  • Chocolatey automatically shims anything in that dir or subdirs after installer script finishes

Possible solutions:

  • download the installer somewhere else if it's needed later for any reason (e.g. is it required for uninstalling? no idea)
  • delete the installer at the end of install script if it's not needed, so Remove-Item $fileLocation

Destroy666x avatar Sep 02 '23 20:09 Destroy666x