Ensure we pave over old data

This commit is contained in:
Paul Betts
2014-09-24 13:30:42 -07:00
parent e314136bf3
commit a20f42434d

View File

@@ -62,12 +62,17 @@ int CUpdateRunner::ExtractUpdaterAndRun(wchar_t* lpCommandLine)
int index = 0;
do {
ZIPENTRY zentry;
wchar_t targetFile[MAX_PATH];
zr = GetZipItem(zipFile, index, &zentry);
if (zr != ZR_OK && zr != ZR_MORE) {
break;
}
// NB: UnzipItem won't overwrite data, we need to do it ourselves
swprintf_s(targetFile, L"%s\\%s", targetDir, zentry.name);
DeleteFile(targetFile);
if (UnzipItem(zipFile, index, zentry.name) != ZR_OK) break;
index++;
} while (zr == ZR_MORE || zr == ZR_OK);