Skip to content

Conversation

vexx32
Copy link
Member

@vexx32 vexx32 commented Jul 6, 2023

Description Of Changes

  • Rewrote the chocolateysetup.psm1 module we use to install Chocolatey

Motivation and Context

This script has barely been touched in the last decade, in part because it's difficult to follow. Gave it a much needed revision to remove unnecessary clutter, make its code patterns more consistent, and be much more sensible in how it declares and calls commands, so that we can be much more confident that things are working how we expect them to.

This should help make it much easier to make changes to going forward, should we ever need to.

Testing

Tests were performed on Win11, Server 2019, and Server 2008R2

  1. Install from scratch using the install.ps1 script we provide on chocolatey.org, providing the -ChocolateyDownloadUrl to point at the locally-built nupkg.
  • Note: on server 2008r2, I had to manually extract the nupkg and run the chocolateyInstall.ps1 due to Many Issues trying to make that script work on that ancient OS (mostly TLS issues I didn't wanna take the time to sort out).
  1. Delete or move the C:\ProgramData\chocolatey folder, then install v2.0 or v2.1 of Chocolatey CLI, then do a choco upgrade --pre -s localfolder/ with the built nupkg in localfolder

Operating Systems Testing

  • Win11
  • Server 2019
  • Server 2008R2

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v2 compatibility checked?

Related Issue

Fixes #3255

@vexx32 vexx32 requested review from AdmiringWorm, corbob and gep13 July 6, 2023 19:35
@gep13
Copy link
Member

gep13 commented Jun 22, 2025

@vexx32 would this be something that you could rebase onto the develop branch, so that we could see if we could get this pulled into the 2.5.0 release?

@vexx32
Copy link
Member Author

vexx32 commented Jun 24, 2025

Mmmm. Complicated. I'll have a stab at a rebase, it'll be manual though, too much has changed in this script since I think.

@vexx32 vexx32 force-pushed the refactor-install-scripts branch from cc4cc5c to ebfa25e Compare June 24, 2025 21:11
@vexx32
Copy link
Member Author

vexx32 commented Jun 24, 2025

@gep13 I've rebased this as best I can I think. I haven't had time to get it tested today to validate I've not re-broken anything, I'll have a look at that tomorrow.

EDIT: I think this is good now?

@vexx32 vexx32 force-pushed the refactor-install-scripts branch from ebfa25e to 4101fbf Compare June 26, 2025 21:28
This script has barely been touched in the last decade, in part because
it's difficult to follow. Gave it a much needed revision to remove
unnecessary clutter, make its code patterns more consistent, and be much
more sensible in how it declares and calls commands, so that we can be
much more confident that things are working how we expect them to.

This should help make it much easier to make changes to going forward,
should we ever need to.
@vexx32 vexx32 force-pushed the refactor-install-scripts branch from 4101fbf to 000d30d Compare June 27, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrite the chocolateysetup.psm1 module
2 participants