Skip to content

Conversation

@vexx32
Copy link
Member

@vexx32 vexx32 commented Oct 7, 2024

Description Of Changes

  • Remove code relating to migration from a C:\chocolatey install folder from the chocolateysetup.psm1 module used for installing Chocolatey.

Motivation and Context

This migration path hasnt been supported or used since pre-1.0 versions of Chocolatey and is dead code.

Removing this now to simplify the install process somewhat and get the old code out of the way as it's not used at all.

Testing

  1. Run build.ps1 to generate a package
  2. Copy the generated nupkg to a fresh VM and take a snapshot
  3. Install Chocolatey using the following PowerShell code from an admin shell, substituting the nupkg path for the nupkg you copied over:
    ${function:Install-Choco} = [scriptblock]::Create((Invoke-WebRequest https://community.chocolatey.org/install.ps1))
    Install-Choco -ChocolateyDownloadUrl ./path/to/chocolatey.nupkg
  4. Ensure the installation completes successfully
  5. Downgrade choco to 2.3.0: choco upgrade chocolatey --allow-downgrade --version 2.3.0 --allow-unofficial
  6. Upgrade choco once again to the built nupkg to ensure the upgrade works appropriately: choco upgrade chocolatey --source ./path/to/nupkg/folder --pre
  7. Ensure the upgrade completes successfully
  8. Restore from snapshot
  9. Set $env:ChocolateyInstall = 'C:\Users\YOUR_USERNAME\chocolatey'
  10. Repeat from step 3 in a non-admin shell to verify things work with a non-admin install as well

Operating Systems Testing

Windows 10

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 v3 compatibility checked?

Related Issue

Fixes #3501

@vexx32 vexx32 requested a review from corbob October 7, 2024 18:41
Copy link
Member

@corbob corbob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code wise this looks good. I still need to give it a test locally.

gep13
gep13 previously requested changes Oct 8, 2024
@vexx32 vexx32 force-pushed the 3051-remove-old-migration-logic branch from c49ddac to 2bdb4e9 Compare October 8, 2024 19:02
@vexx32 vexx32 marked this pull request as draft October 16, 2024 13:28
@vexx32 vexx32 force-pushed the 3051-remove-old-migration-logic branch from 2bdb4e9 to a36cab5 Compare October 16, 2024 15:46
@vexx32 vexx32 marked this pull request as ready for review October 16, 2024 16:00
@corbob corbob changed the title (#3051) Remove old install migration code (#3501) Remove old install migration code Oct 16, 2024
This migration path hasnt been supported or used since pre-1.0 versions
of Chocolatey and is dead code.

Removing this now to simplify the install process somewhat and get the
old code out of the way as it's not used at all.
@vexx32 vexx32 force-pushed the 3051-remove-old-migration-logic branch from a36cab5 to 44a9fd1 Compare October 29, 2024 14:48
Copy link
Member

@corbob corbob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@corbob corbob dismissed gep13’s stale review October 29, 2024 21:19

We're not (currently) able to remove the variable as previously thought.

@corbob corbob merged commit 808c28b into chocolatey:develop Oct 29, 2024
5 checks passed
@corbob corbob mentioned this pull request Oct 29, 2024
10 tasks
@vexx32 vexx32 deleted the 3051-remove-old-migration-logic branch October 31, 2024 19:15
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.

Remove historical folder migration logic from chocolateysetup.psm1

3 participants