diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2018-04-10 22:40:16 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2018-04-23 16:59:26 +0200 |
commit | 9e36039630db3935e316ecd378e6826f4e5c3a5c (patch) | |
tree | fe5c3b8df594957a54d79cfca4c78c83808a6ef0 /src/Setup/SelfExtract.c | |
parent | 29b80ec6df43a48877efdeba68d59d78ee4e8074 (diff) | |
download | VeraCrypt-9e36039630db3935e316ecd378e6826f4e5c3a5c.tar.gz VeraCrypt-9e36039630db3935e316ecd378e6826f4e5c3a5c.zip |
Windows: when extracting files in Setup or Portable mode, decompress zip files docs.zip and Languages.zip in order to have ready to use configuration.
Diffstat (limited to 'src/Setup/SelfExtract.c')
-rw-r--r-- | src/Setup/SelfExtract.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/Setup/SelfExtract.c b/src/Setup/SelfExtract.c index 8c155c64..9bae2119 100644 --- a/src/Setup/SelfExtract.c +++ b/src/Setup/SelfExtract.c @@ -644,20 +644,38 @@ void __cdecl ExtractAllFilesThread (void *hwndDlg) { wchar_t fileName [TC_MAX_PATH] = {0}; wchar_t filePath [TC_MAX_PATH] = {0}; + BOOL bResult = FALSE, zipFile = FALSE; // Filename StringCchCopyNW (fileName, ARRAYSIZE(fileName), Decompressed_Files[fileNo].fileName, Decompressed_Files[fileNo].fileNameLength); StringCchCopyW (filePath, ARRAYSIZE(filePath), DestExtractPath); StringCchCatW (filePath, ARRAYSIZE(filePath), fileName); + if ((wcslen (fileName) > 4) && (0 == wcscmp (L".zip", &fileName[wcslen(fileName) - 4]))) + zipFile = TRUE; + StatusMessageParam (hwndDlg, "EXTRACTING_VERB", filePath); + if (zipFile) + { + bResult = DecompressZipToDir ( + Decompressed_Files[fileNo].fileContent, + Decompressed_Files[fileNo].fileLength, + DestExtractPath, + CopyMessage, + hwndDlg); + } + else + { + bResult = SaveBufferToFile ( + (char *) Decompressed_Files[fileNo].fileContent, + filePath, + Decompressed_Files[fileNo].fileLength, + FALSE, FALSE); + } + // Write the file - if (!SaveBufferToFile ( - Decompressed_Files[fileNo].fileContent, - filePath, - Decompressed_Files[fileNo].fileLength, - FALSE, FALSE)) + if (!bResult) { wchar_t szTmp[512]; |