chocolatey / chocolatey/choco

Run `chocolateyBeforeModify.ps1` by default on reinstallations

Open
#2,088 15 comments 0 reactions 0 assignees View on GitHub
0 - Triaging Documentation Enhancement
Dominant language
C#
Stars
11.5k
Forks
960
PR merge metrics
No merged PRs in 30d

Description

Started on https://github.com/chocolatey-community/chocolatey-coreteampackages/pull/1517:

> I just noticed one problem:
>
> 1. Install this package
> 2. Open Code Insiders
> 3. Force reinstall
>
> It will fail because `chocolateyBeforeModify.ps1` does not run before a reinstallation.
>
> I'll make it run in `chocolateyInstall.ps1` so. By the way, I suggest considering run `chocolateyBeforeModify.ps1` by default on reinstallations.

This would help both users trying to reinstall a package and also users who had the package installed by other means and wanted to reinstall using Chocolatey.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the reinstall reproduction steps and the linked chocolatey-coreteampackages pull request. Inspect chocolateyBeforeModify.ps1 and chocolateyInstall.ps1, then trace the reinstall flow to determine when the pre-modification script runs. Done means reinstalling a package runs chocolateyBeforeModify.ps1 by default without breaking the force-reinstall scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.