Using the "Uninstall Partiality" button consistently fails for me.
The problem seems to be that Directory.Delete is not synchronous. When the Managed directory is deleted it can take some time to complete, causing its immediate recreation to happen too early which ultimately leads to there not being a Managed directory when Partiality starts to copy over files from the backup directory which then causes an exception and crashes the launcher.
Using the "Uninstall Partiality" button consistently fails for me.
The problem seems to be that
Directory.Delete
is not synchronous. When theManaged
directory is deleted it can take some time to complete, causing its immediate recreation to happen too early which ultimately leads to there not being aManaged
directory when Partiality starts to copy over files from the backup directory which then causes an exception and crashes the launcher.See for example also this stack overflow post: https://stackoverflow.com/questions/35069311/why-sometimes-directory-createdirectory-fails
This PR should fix the problem by ensuring the directory is really deleted before recreating it.