IDEA-130718 Updater leaves behind a broken installation if it fails to open a file on Windows

This commit is contained in:
Vladimir.Orlov
2014-10-03 12:06:42 +04:00
parent 421442934f
commit 3c4ecd9869
@@ -51,7 +51,9 @@ public class DeleteAction extends PatchAction {
}
protected void doRevert(File toFile, File backupFile) throws IOException {
Utils.delete(toFile); // make sure there is no directory remained on this path (may remain from previous 'create' actions
Utils.copy(backupFile, toFile);
if (!toFile.exists() || isModified(toFile)) {
Utils.delete(toFile); // make sure there is no directory remained on this path (may remain from previous 'create' actions
Utils.copy(backupFile, toFile);
}
}
}