-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[Windows] Removing $env:SystemRoot\Installer\* causes installer and uninstaller issues #11119
Comments
Hi @AjkayAlan , Working on your issue , we will update you ASAP. thanks for your support ! |
Hi @AjkayAlan , I request you please try to use pwsh to install/ uninstall packages , it will fix the problem . thank you !
|
Hi @kishorekumar-anchala - Unfortunately I don't believe that is working for the example I provided. Instead, it simply isn't doing anything. Here is an example workflow using name: Example Workflow
on:
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
example_job:
name: Example Job
runs-on: windows-latest
defaults:
run:
shell: pwsh
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Packages Before Uninstall
run: |
Get-Package | Where Name -Match "^Node"
- name: Cleanup Node
run: |
Get-Package | Where Name -Match "^Node" | Uninstall-Package
- name: Get Packages After Uninstall
run: |
Get-Package | Where Name -Match "^Node" When running that workflow, it "passes" but doesn't actually do anything. Here is a raw log output excerpt - you can see that the
If I switch to PowerShell 5, my Get-Package does output things correctly, but fails due to the root cause of this ticket (which I believe was the change to remove all entries in
So - to summarize, switching to PowerShell 7 ( |
Hi @AjkayAlan, Sorry for introducing such a breaking change. We are going to revert it in windows-2019 and windows-2022 images, but for now we will leave it for windows-2025 image. This was a necessary step to make the windows-2025 image less than 150GB. We assumed that no one was deleting packages during execution. We'll look at how to keep enough free disk space without deleting the contents of the |
@Alexey-Ayupov - No worries, and I totally get it! Thank you for reverting that change for the existing runner images (assuming that is the root cause). IMO making that a breaking change for the Windows 2025 images makes sense, and gives people a chance to "opt in" to that change so they can figure out better ways to do things. I will agree, we are definitely stretching the use cases of how we use the runner images, in part that for us its so easy to inherit all the goodness and hard work that you all have done with the images, and then just change our small pieces as necessary. Thanks again for being open to reverting that change - and if there is anything I can do to help, please let me know. |
HI @AjkayAlan , |
Hi @kishorekumar-anchala! Unfortunately I will need to wait until there is a tag cut and the image is updated on GitHub Actions (as I am using the github hosted runners running these images). That, or is there another way to get the updated image in GitHub Actions for a beta test? |
@kishorekumar-anchala looks like the deployment completed and I can confirm that the issue is now fixed with:
Thank you again! This can be marked as resolved! |
thankyou @AjkayAlan for your confirmation. |
Description
Windows 20241201 images introduced more aggressive cleanup behavior as part of the build process. One of the additions to the logic was to delete
$env:SystemRoot\Installer\*
per (https://github.com/actions/runner-images/blob/main/images/windows/scripts/build/Invoke-Cleanup.ps1#L18)This causes issues for anyone working with upgrading or uninstalling the existing installed packages on the image that are installed as MSI's - as now existing packages installed as MSI's have broke installers/uninstallers and throw nasty errors when trying to interact with them.
For instance, if I try to clean up
NodeJS
installations before installingnvm-windows
(as nvm-windows gets somewhat upset if any NodeJS installs exist when installing) via a command like the following in PowerShell:Get-Package | Where Name -Match "^Node" | Uninstall-Package
, I now get anInvalidOperation
error:Microsoft themselves say its not a good idea to delete files in this directory per https://blogs.technet.microsoft.com/joscon/2012/01/18/can-you-safely-delete-files-in-the-windirinstaller-directory/. My expectation is that others using Windows runners may have started encountering issues with their tools if they did similar things, such as #11095
Can this specific change be removed?
Platforms affected
Runner images affected
Image version and build link
Image: windows-2022
Version: 20241201.2.0
Included Software: https://github.com/actions/runner-images/blob/win22/20241201.2/images/windows/Windows2022-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20241201.2
Is it regression?
Yes. windows-2022 version 20241125.1.0 worked as expected
Expected behavior
Software installed as MSI's should be able to be uninstalled/updated without error.
Actual behavior
When attempting to modify or uninstall software on the image that was installed as an MSI, errors are thrown.
Repro steps
Get-Package | Where Name -Match "^Node" | Uninstall-Package
Here is an example github action:
The text was updated successfully, but these errors were encountered: