Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#3501) Remove old install migration code #3528

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

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.

@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
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 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
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.

Chocolatey folder migration logic should be removed from chocolateysetup.psm1 file
3 participants