mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Ensure we pave over old data
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user