Update halted when folder cannot be deleted

Description

I wanted to update Commandbox 4.7.0 to 5.0.1. I had issues in the past using a newer version version of Commandbox after an update because of cached files that were left in the folders
C:\Users\XXX\.CommandBox\engine\cfml\cli\cfml-web\cfclasses
C:\Users\XXX\.CommandBox\cfml\system\mdCache

To see what happens to the files in the folders I opened both folders in Windows Explorer and put them on one monitor. On the second monitor I started box.exe and was left with the following screen.

So I left the folder in Windows Explorer and quit box.exe using CTRL + X.
I restarted box and got the next exception because one of the folders it tries to delete had already been deleted during the first run. I manually created the folder and restarted box so I could finally run and use the new version.

Maybe you can modify the setup to find out if the folder exists at all, before you try to delete it.

Activity

Show:
Brad Wood
April 7, 2020, 10:07 AM

There are three folders that get deleted on an upgrade.

 

Two of them check for existence. The third one tries, but looks as though a copy/paste error has it checking the wrong dir. I don’t know why you would have gotten an error for the system dir since that exists check seems fine. It could have been Windows still had locks on the folders from them being open. There’s not a whole lot I can do if the folders are locked, other than catch the errors and try to output something more useful to the user. I can’t say anyone other than yourself has managed to run into this

Looking at the delete code, it seems there already IS a more “friendly” message, but I suppose it just isn’t friendly enough

 

Brad Wood
May 30, 2020, 5:21 AM

I updated the typo to check for the correct folder, but if there are locks on the folder in Windows, there's not much I can do.

Fixed

Assignee

Brad Wood

Reporter

Bernhard Döbler

Labels

None

Affects versions

Fix versions

Priority

Major