- do I check to see if the package is already installed with choco list command in the chocolateybeforemodify script and then uninstall it if it’s found? But how can I determine if the beforemodify script is called due to upgrade or uninstall?
- or do I check to see if the package is already installed in the chocolateyinstall script? I also tried doing it in this script by checking
$chocoPackage = choco list $myPackageName --exact | Where-Object {$_.StartsWith($myPackageName)} if ($chocoPackage -ne $null) { }
but it’s true even when it’s not installed.