-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[5.4][6.0] Fix installation error on Windows #46286
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
base: 5.4-dev
Are you sure you want to change the base?
Conversation
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
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.
From past investigations I know the problem and had it fixed, but it seems that got lost with the changes for the automated updates.
The fix here is what I had in mind, too, but you beat me to it.
Unfortunately I can't do a real test right now as I don't have an environment ready which has that issue.
You cant test this properly with the download in this pr as that still has the dev_status=development and that needs to be manually changed before trying to install |
I have tested this item ✅ successfully on 77e58b5 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46286. |
Or get a fresh installation of Joomla 5.4, then replace the file installation/src/Model/CleanupModel.php in the package with the file change in this PR as I wrote in testing instructions. I do not know if there is an easier way to test this. |
Pull Request for Issue #46284.
Summary of Changes
At the end of the installation process, Joomla attempts to delete the installation folder.
On Windows, this operation consistently throws a
FilesystemException
because PHP locks the currently executingindex.php
file, preventing its immediate removal.The exception was not caught, causing a fatal error and breaking the cleanup process.
This PR fixes the issue by wrapping the folder deletion in a try/catch block and returning false when an exception is thrown, instead of letting it crash.
Additionally, a Windows-specific workaround has been added:
if the installation folder contains no subfolders and only the (already deleted but still locked) index.php file, we can assume the deletion was effectively successful and continues the cleanup process.
Testing Instructions
Actual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
PS: I used ChatGTP to improve the PR description and code comment to make it more clear :D. It provides better, clear messages than mine :D