Skip to content

(maint) Add 7zip update script from support branches and enhance for updated workflow#3900

Merged
corbob merged 4 commits into
chocolatey:developfrom
AdmiringWorm:7zip-fetch-script
May 25, 2026
Merged

(maint) Add 7zip update script from support branches and enhance for updated workflow#3900
corbob merged 4 commits into
chocolatey:developfrom
AdmiringWorm:7zip-fetch-script

Conversation

@AdmiringWorm

Copy link
Copy Markdown
Member

Description Of Changes

  • Add script to fetch latest 7-zip files and extract them to the correct repository location
  • Enhance 7-zip update script with improved error handling and code clarity
  • Automate CREDITS.json file update process to reduce manual steps
  • Add type annotation to Version parameter for improved code clarity
  • Rename variables for better reuse and maintainability
  • Add validation and warning when 7-Zip entry not found in CREDITS.json
  • Require PowerShell Core for script execution
  • Automate updating 7-vip version in BundleApplications.Tests.ps1
  • Make Credits.json file consistent with what PowerShell ConvertTo-Json uses for indentation

Motivation and Context

Streamline the 7-zip version update process by automating manual steps and improving script robustness with explicit error handling and validation.

Testing

  1. Run the script for a different version of 7-zip. I.e .\Update-7zipVersion.ps1 -Version 26.00
  2. Verify the 7zip.exe, dll and CREDITS.json file were correctly updated.
  3. Run the script against a non-existing version of 7zip. I.e. .\Update-7zipVersion.ps1 -Version 26.02
  4. Verify a 404 Not Found message is outputted, and nothing was updated.

Operating Systems Testing

  • Windows 11

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.
  • Build System Releated 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?
  • All items are complete on the Definition of Done.

Related Issue

N/A

corbob and others added 4 commits May 15, 2026 14:39
This is a quick and dirty script that fetches the specified 7-zip
version and extracts them to the correct location in the repository.

(cherry picked from commit 10db128)
Update the Update-7zipVersion.ps1 script to improve error handling, code
clarity, and automate the CREDITS.json file update process. The script
now requires PowerShell Core, adds explicit error handling, and
automatically updates the 7-Zip version entry in the CREDITS.json file
instead of requiring manual updates.

Key Changes:
- Add explicit error action preference for better error handling
- Add type annotation to Version parameter for clarity
- Rename variable to VersionWithoutDots for improved reuse
- Automate CREDITS.json update with version information
- Add validation and warning when 7-Zip entry not found
- Update user message to reflect automated CREDITS update

Reason for the change:
- Improve script robustness with proper error handling
- Reduce manual steps required after running the script
- Enhance code maintainability with clearer variable names
- Ensure consistency in CREDITS.json without manual edits
- Provide feedback when manual intervention is needed
Update the 7zip version update script to automatically update
the bundled applications test file with the new version number instead
of requiring manual updates.

Key Changes:
- Add automatic detection and update of the
  BundledApplications.Tests.ps1 file
- Implement regex pattern matching to find and replace the 7zip version
  in test file
- Add error handling with warning message if test file is not found
- Update final status message to display the new version number

Reason for the change:
- Eliminate manual test file updates after each 7zip version bump
- Reduce human error and ensure test file stays in sync with actual 7zip
  version
- Improve automation workflow by making the update process
  self-contained
Update the CREDITS.json file to use consistent 2-space indentation
throughout the document instead of the previous 4-space indentation.
This aligns with modern JSON formatting standards and improves
readability.

Key Changes:
- Convert all indentation from 4 spaces to 2 spaces
- Maintain all existing content and structure
- Ensure valid JSON formatting is preserved

Reason for the change:
- Establish consistent code style across documentation
- Reduce file size and improve maintainability
- Follow industry best practices for JSON formatting
- PowerShell ConvertTo-Json automatically creates JSON using 2 spaces
@AdmiringWorm AdmiringWorm added this to the vNext milestone May 15, 2026
@AdmiringWorm
AdmiringWorm requested review from corbob and gep13 May 15, 2026 12:42
@AdmiringWorm AdmiringWorm self-assigned this May 15, 2026
@AdmiringWorm
AdmiringWorm requested a review from a team as a code owner May 15, 2026 12:42
@AdmiringWorm AdmiringWorm added the Build Automation Issues for changes to the build system, without functional changes needed to the project. label May 15, 2026

@gep13 gep13 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

From a Code Owners perspective this LGTM!

@AdmiringWorm AdmiringWorm modified the milestones: vNext, 2.7.3 May 21, 2026

@corbob corbob left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@corbob
corbob merged commit ae79d9f into chocolatey:develop May 25, 2026
5 checks passed
@corbob

corbob commented May 25, 2026

Copy link
Copy Markdown
Member

Thanks for getting this pulled from the support branch and enhanced here @AdmiringWorm 👍

@AdmiringWorm
AdmiringWorm deleted the 7zip-fetch-script branch May 26, 2026 09:22
@AdmiringWorm AdmiringWorm modified the milestones: 2.7.3, 2.x May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build Automation Issues for changes to the build system, without functional changes needed to the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants