From 585eaaafeac8bff2d84d3a7c54b560437e97e255 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 5 Jun 2014 23:00:22 +0530 Subject: [PATCH] More accurate progress while decompressing the portable installer --- setup/installer/windows/portable-installer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup/installer/windows/portable-installer.cpp b/setup/installer/windows/portable-installer.cpp index 87f444c6ac..4929fb2312 100644 --- a/setup/installer/windows/portable-installer.cpp +++ b/setup/installer/windows/portable-installer.cpp @@ -188,6 +188,7 @@ output_callback(void *ctx, const void *buf, size_t size) return 0; } written = SetFilePointer(ds->out, 0, NULL, FILE_CURRENT); + FlushFileBuffers(ds->out); // Ensure progress is accurate, otherwise there is a long pause after the decompressing phase while the OS flushes to a slow flash drive ds->pd->SetProgress(written, UNCOMPRESSED_SIZE); } @@ -245,8 +246,6 @@ static BOOL extract(LPVOID cdata, DWORD csz) { pd->StartProgressDialog(NULL, NULL, PROGDLG_NORMAL | PROGDLG_AUTOTIME | PROGDLG_NOCANCEL, NULL); if (!decompress(cdata, csz, h, pd)) { ret = false; goto end; } - pd->SetLine(1, L"Reading manifest", true, NULL); - pd->SetProgress(1, 1000); SetFilePointer(h, 0, NULL, FILE_BEGIN); zipf = OpenZip(h, 0, ZIP_HANDLE); if (zipf == 0) { show_last_error(L"Failed to open zipped portable data"); ret = false; goto end; }