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

Different versions of choco with different behavior - How to handle this in packages? #128

Closed
dhilgarth opened this issue Feb 26, 2015 · 12 comments

Comments

@dhilgarth
Copy link

I am wondering how to handle the different behavior of different choco versions in packages.
For example, PowerShell choco removed the unzipped files. Choco 0.9.9-rc8 doesn't.
Likewise, PowerShell choco doesn't have Install-ChocolateyShortcut but the new choco does.

What is the best practice in making packages work in all environments?

@ferventcoder
Copy link
Member

#121 will handle the unzipped files. That is not a package script concern.

@ferventcoder
Copy link
Member

When things get added you have to decide whether to use and when to use. That's how you handle new things. You can also add the script to the package and use it if a command for it is not found.

@ferventcoder
Copy link
Member

There are examples of doing that with bin root. Also, this seems more like a question than an issue - please use the gitter chat room for that - https://gitter.im/chocolatey/choco

@ferventcoder
Copy link
Member

I think this can be closed, unless we want this to be a documentation issue. We've added new functions over time before though.

@jberezanski
Copy link

Perhaps we could document a way for the package to determine Chocolatey version.

@dhilgarth
Copy link
Author

In most cases, feature detection would be better. You can see an example here: https://github.com/dhilgarth/chocolatey-packages/blob/master/automatic/procmon/tools/chocolateyinstall.ps1#L12

@ferventcoder
Copy link
Member

@dhilgarth yes, but it's a bit more work on the maintainer to do so.

@dhilgarth
Copy link
Author

So you propose to include the new module with the package?

@ferventcoder
Copy link
Member

Usually if you want to take advantage of the feature but support older versions, you either do all of the work yourself or just include the function. It's less boilerplate for you to write if you include the function.

@jberezanski
Copy link

I agree that feature detection is generally more robust. However, in Chocolatey, only the presence of helper functions can be currently detected, so this method could not be used to handle Chocolatey behavior changes (such as the removal of unzipped files - fortunately, this one will not change after all).

@corbob
Copy link
Member

corbob commented Jun 30, 2022

Duplicate of #121

@corbob corbob marked this as a duplicate of #121 Jun 30, 2022
@corbob corbob closed this as not planned Won't fix, can't repro, duplicate, stale Jun 30, 2022
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

5 participants