VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2018-04-10 20:40:16 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2018-04-23 14:59:26 (GMT)
commit9e36039630db3935e316ecd378e6826f4e5c3a5c (patch)
treefe5c3b8df594957a54d79cfca4c78c83808a6ef0
parent29b80ec6df43a48877efdeba68d59d78ee4e8074 (diff)
downloadVeraCrypt-9e36039630db3935e316ecd378e6826f4e5c3a5c.zip
VeraCrypt-9e36039630db3935e316ecd378e6826f4e5c3a5c.tar.gz
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.
-rw-r--r--src/Setup/SelfExtract.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/Setup/SelfExtract.c b/src/Setup/SelfExtract.c
index 8c155c6..9bae211 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];