-
Notifications
You must be signed in to change notification settings - Fork 0
🩹 [Patch]: Fix Windows PowerShell downgrade installation #4
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
Conversation
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
…tionality Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Is it as simple as removing what you have added so far, but instead modifying the installation command to use force for windows based installations? Seems that we can use that even if it is an upgrade. With this approach we also can remove the eval to the degrade that you also added. |
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
You're absolutely right! I've simplified the approach by removing all the version comparison logic and using |
Change of plan. Lets use the current logic to find if we are doing a downgrade using the version class and parse the versions. We need to reinstall the package if it is a downgrade request. |
…etection Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
I've implemented the version comparison logic as requested. The Windows installation now uses PowerShell's
The logic includes error handling for version parsing edge cases and preserves the existing behavior for same versions. (00a357a) |
The test that would downgrade to 7.4.7 is still failing. Seems the install just shortcircuts. How about we add a REINSTALL variable with the value 'a'? |
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Added |
Lets add a section for the windows based downgrade to uninstall the previous version before installing the new version. |
…grades Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Implemented the uninstall-then-install approach for Windows PowerShell downgrades. The logic now finds the existing PowerShell installation via registry lookup, extracts the product code, uses |
…nstallation if the requested version is already installed
4c361ee
to
c03a876
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request refines the PowerShell installation process for Windows GitHub runners by improving downgrade detection and uninstall handling.
- Improved download and installation messages for Linux and macOS.
- Introduced Windows-specific downgrade detection and uninstallation logic.
- Fixed minor typos in echo messages.
Comments suppressed due to low confidence (2)
action.yml:233
- Using 'StartsWith' to match the display version may be too broad and could select unintended versions. Consider casting the DisplayVersion to a proper version object and comparing it explicitly to ensure accurate version matching.
$_.DisplayVersion -and $_.DisplayVersion.StartsWith($detected)
action.yml:236
- [nitpick] Selecting the first matching uninstall entry may be ambiguous if multiple entries exist. It would be helpful to add a comment clarifying the criteria or ensuring there's a unique match for the uninstall process.
$targetEntry = $pwshEntries | Select-Object -First 1
This pull request refines the PowerShell installation process on Windows based GitHub runners.
Windows-Specific Enhancements: