chocolatey / chocolatey/choco

Install-ChocolateyPackage / Install-ChocolateyInstallPackage - In addition to SoftwareDisplayName/Version, add a flag for uninstall/reinstall

Open
#1,714 3 comments 0 reactions 0 assignees View on GitHub
0 - Backlog CoreTeam Enhancement
Dominant language
C#
Stars
11.5k
Forks
960
PR merge metrics
No merged PRs in 30d

Description

Sometimes during packaging it would be nice to know if the package is being installed or upgraded.

This comes in to play when some programs need to be uninstalled before a new version can be installed (drobo-dashboard off the top of my head).

Sure, we packagers can check "things" to figure it out, but a variable check would be a lot easier.

SUGGESTION:
$ENV:ChocolateyInstall = $True or $False as it can be assumed that if $ENV:ChocolateyInstall is false than an upgrade status would be $True. (Unless there are other scenarios I can't think of right now.)

or

$ENV:ChocoInstall = $True or $False as it can be assumed that if $ENV:ChocoInstall is false than an upgrade status would be $True. (Unless there are other scenarios I can't think of right now.)

or maybe since the upgrade status is more important, $ENV:ChocolatyUpgrade or $ENV:ChocoUpgrade would be more relevant and if $False it could be assumed an install was happening versus an upgrade.

Contributor guide

Open the contributing guide

Research direction

Start by locating the Install-ChocolateyPackage and Install-ChocolateyInstallPackage entry points named in the issue, then trace how package installation and upgrades are distinguished. Define the supported install or upgrade state and its behavior across the scenarios described; done means package scripts can reliably read that state, with coverage for both installation and upgrade paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.