Run `chocolateyBeforeModify.ps1` by default on reinstallations
- 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
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