packageupgradechocolatey

What is the recommend way of only allowing one version of a choco package to be installed?



Solution

  • Chocolatey CLI will take care of the package. What you're asking about is the software.

    The chocolateyBeforeModidy.ps1 is run during upgrade or uninstall of the package. It's generally used to check for running services, processes, etc.

    Don't using choco command inside package scripts. It may lead to issues.

    The best way to check if software is already installed is to check whatever it does to the system to 'register' it's installed. So this could be registry changes, file system changes or something else.

    I do this with Keepass plugin packages that I maintain. As Keepass could be installed in many places, and in different ways, I check them all.