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

[BUG] Chocolatey package leaves old version shims #2173

Open
Destroy666x opened this issue Apr 13, 2023 · 4 comments
Open

[BUG] Chocolatey package leaves old version shims #2173

Destroy666x opened this issue Apr 13, 2023 · 4 comments

Comments

@Destroy666x
Copy link

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
@imolorhe
Copy link
Collaborator

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.

@Destroy666x
Copy link
Author

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
Copy link
Author

Destroy666x commented Sep 2, 2023

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants