UI/updater: Fix silent failure on auto-update
parent
31414d2d7a
commit
e87a97eb8c
|
@ -798,9 +798,12 @@ static void AddPackageRemovedFiles(const Json &package)
|
||||||
/* Technically GetFileAttributes can fail for other reasons,
|
/* Technically GetFileAttributes can fail for other reasons,
|
||||||
* so double-check by also checking the last error */
|
* so double-check by also checking the last error */
|
||||||
if (GetFileAttributesW(removedFileName) ==
|
if (GetFileAttributesW(removedFileName) ==
|
||||||
INVALID_FILE_ATTRIBUTES &&
|
INVALID_FILE_ATTRIBUTES) {
|
||||||
GetLastError() == ERROR_FILE_NOT_FOUND)
|
int err = GetLastError();
|
||||||
continue;
|
if (err == ERROR_FILE_NOT_FOUND ||
|
||||||
|
err == ERROR_PATH_NOT_FOUND)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
deletion_t deletion;
|
deletion_t deletion;
|
||||||
deletion.originalFilename = removedFileName;
|
deletion.originalFilename = removedFileName;
|
||||||
|
@ -1577,9 +1580,13 @@ static bool Update(wchar_t *cmdLine)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (deletion_t &deletion : deletions)
|
for (deletion_t &deletion : deletions) {
|
||||||
if (!RenameRemovedFile(deletion))
|
if (!RenameRemovedFile(deletion)) {
|
||||||
|
Status(L"Update failed: Couldn't remove "
|
||||||
|
L"obsolete files");
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ------------------------------------- *
|
/* ------------------------------------- *
|
||||||
* Install virtual camera */
|
* Install virtual camera */
|
||||||
|
|
Loading…
Reference in New Issue