Tyrrrz/Onova

Back up files before overwriting

Tyrrrz opened this issue · 2 comments

Version

2.6.2

Details

Sometimes overwriting updatee files may fail and, because it's not an atomic operations, the installation may become corrupted. In such cases we need to backup the updatee files and revert the changes if the overwrite fails. Additionally, we probably need some retry mechanism.

image

Steps to reproduce

n/a

What probably happened there was that the apphost was unloaded, which released the lock on the .dll file. However, the apphost itself (the .exe file) was still running for a split nanosecond, causing an exception. A simple wait-and-retry would probably have handled it.

With the new directory locking, backing up is no longer required. The locking mechanism will prevent files from being modified and the app from running for the entire duration of the update process.