octobercms / install

Installation wizard for October CMS
122 stars 91 forks source link

Add recursive delete of files and folders after installation is finished #97

Closed Samuell1 closed 4 years ago

Samuell1 commented 5 years ago

Resolves https://github.com/octobercms/october/issues/4274

w20k commented 5 years ago

@LukeTowers, sure! Will run a few tests, tomorrow! Will ping you, when finished.

w20k commented 5 years ago

@LukeTowers works fine, but one minor fix should be added.

It doesn't remove install.php (README.md as well) file from the root directory. And if something failed during the process it adds .log file inside of install_files dir: install_files/install.log. So, when the installation is finished, and successfully, it will still fail.

Screenshot:

Screenshot 2019-07-29 at 19 42 55
LukeTowers commented 5 years ago

@Samuell1 could you look into that please?

Samuell1 commented 5 years ago

@LukeTowers i think we should move install.log from install_files folder to root.

w20k commented 5 years ago

@Samuell1 tried your latest fix. Now install.log is there, install.php was removed, but dirs still there. Screenshot 2019-08-06 at 16 58 20

LukeTowers commented 5 years ago

Under what conditions would you retain install.log but not retain the install files? AFAIK install.log is just for if there was an error preventing the installation from completing, in which case you would not want to remove the install_files?

Samuell1 commented 5 years ago

@LukeTowers install.log is not created only on errors but after every step.

LukeTowers commented 5 years ago

@Samuell1 so if there are any errors period the installation will not complete and the files will not be removed? If that's the case then I would prefer that a fully clean install.log (i.e. no errors) just gets removed along with the rest of the installation files.

Samuell1 commented 5 years ago

I think it should work like that now.

LukeTowers commented 5 years ago

@Samuell1 So you can verify that after the install process is successfully completed all install files (install_files directory, install.log, install.php) are completely removed?

w20k commented 5 years ago

@Samuell1 ping me if re-test is needed.

Samuell1 commented 5 years ago

@w20k You can if you have time but i tested it yesterday and works great. I sended a video of steps to @LukeTowers privately.

LukeTowers commented 5 years ago

@w20k can you test what happens if the install fails at any point before or during the cleanInstall step? I would like to get rid of the notice at the end telling people to clean up after the installer but I don't want to remove it outright if we aren't handling failure cases properly (such as error during install or incorrect permissions to remove the files required to clean up after the installation process)

w20k commented 5 years ago

Sure @LukeTowers will do!

Samuell1 commented 5 years ago

@LukeTowers if cleaning of files will throw error it will silently continue.