Skip to content

Conversation

joomdonation
Copy link
Contributor

@joomdonation joomdonation commented Oct 15, 2025

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 executing index.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

  • Error while installing Joomla on Windows

Expected result AFTER applying this Pull Request

  • The error is fixed

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

joomdonation and others added 2 commits October 15, 2025 13:53
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Copy link
Member

@richard67 richard67 left a 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.

@richard67 richard67 added the bug label Oct 15, 2025
@brianteeman
Copy link
Contributor

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

@brianteeman
Copy link
Contributor

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.

@joomdonation
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants