1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2026-07-06 13:08:00 -05:00

Windows: Add HTML documentation to Windows installer.

This commit is contained in:
Mounir IDRASSI
2017-05-15 01:01:21 +02:00
parent b5abd54c1b
commit 6fe660c249
6 changed files with 145 additions and 25 deletions
+39 -15
View File
@@ -557,7 +557,7 @@ void StatusMessage (HWND hwndDlg, char *stringId)
SendDlgItemMessage (hwndDlg, IDC_LOG_WINDOW, LB_GETCOUNT, 0, 0) - 1, 0);
}
void StatusMessageParam (HWND hwndDlg, char *stringId, wchar_t *param)
void StatusMessageParam (HWND hwndDlg, char *stringId, const wchar_t *param)
{
wchar_t szTmp[1024];
@@ -576,23 +576,23 @@ void ClearLogWindow (HWND hwndDlg)
SendMessage (GetDlgItem (hwndDlg, IDC_LOG_WINDOW), LB_RESETCONTENT, 0, 0);
}
void RegMessage (HWND hwndDlg, wchar_t *txt)
void RegMessage (HWND hwndDlg, const wchar_t *txt)
{
StatusMessageParam (hwndDlg, "ADDING_REG", txt);
}
void CopyMessage (HWND hwndDlg, wchar_t *txt)
void _cdecl CopyMessage (HWND hwndDlg, const wchar_t *txt)
{
StatusMessageParam (hwndDlg, "INSTALLING", txt);
}
void RemoveMessage (HWND hwndDlg, wchar_t *txt)
void RemoveMessage (HWND hwndDlg, const wchar_t *txt)
{
if (!Rollback)
StatusMessageParam (hwndDlg, "REMOVING", txt);
}
void IconMessage (HWND hwndDlg, wchar_t *txt)
void IconMessage (HWND hwndDlg, const wchar_t *txt)
{
StatusMessageParam (hwndDlg, "ADDING_ICON", txt);
}
@@ -672,7 +672,7 @@ BOOL DoFilesInstall (HWND hwndDlg, wchar_t *szDestDir)
for (i = 0; i < sizeof (szFiles) / sizeof (szFiles[0]); i++)
{
BOOL bResult, driver64 = FALSE;
BOOL bResult, driver64 = FALSE, zipFile = FALSE;
wchar_t szDir[TC_MAX_PATH];
if (wcsstr (szFiles[i], L"VeraCrypt Setup") != 0)
@@ -696,7 +696,7 @@ BOOL DoFilesInstall (HWND hwndDlg, wchar_t *szDestDir)
continue;
}
if (*szFiles[i] == L'A')
if ((*szFiles[i] == L'A') || (*szFiles[i] == L'X'))
StringCbCopyW (szDir, sizeof(szDir), szDestDir);
else if (*szFiles[i] == L'D')
{
@@ -717,7 +717,17 @@ BOOL DoFilesInstall (HWND hwndDlg, wchar_t *szDestDir)
if (*szFiles[i] == L'I')
continue;
if (*szFiles[i] == L'X')
zipFile = TRUE;
StringCbPrintfW (szTmp, sizeof(szTmp), L"%s%s", szDir, szFiles[i] + 1);
if (zipFile)
{
// build folder name by removing .zip extension
wchar_t* ptr = wcsrchr (szTmp, L'.');
if (ptr)
*ptr = 0;
}
if (bUninstall == FALSE)
CopyMessage (hwndDlg, szTmp);
@@ -805,13 +815,24 @@ BOOL DoFilesInstall (HWND hwndDlg, wchar_t *szDestDir)
bResult = FALSE;
goto err;
}
bResult = SaveBufferToFile (
(char *) Decompressed_Files[fileNo].fileContent,
szTmp,
Decompressed_Files[fileNo].fileLength,
FALSE,
TRUE);
if (zipFile)
{
bResult = DecompressZipToDir (
Decompressed_Files[fileNo].fileContent,
Decompressed_Files[fileNo].fileLength,
szDir,
CopyMessage,
hwndDlg);
}
else
{
bResult = SaveBufferToFile (
(char *) Decompressed_Files[fileNo].fileContent,
szTmp,
Decompressed_Files[fileNo].fileLength,
FALSE,
TRUE);
}
if (driver64)
{
@@ -907,7 +928,10 @@ BOOL DoFilesInstall (HWND hwndDlg, wchar_t *szDestDir)
{
if (driver64)
EnableWow64FsRedirection (FALSE);
bResult = StatDeleteFile (szTmp, TRUE);
if (zipFile)
bResult = StatRemoveDirectory (szTmp);
else
bResult = StatDeleteFile (szTmp, TRUE);
if (driver64)
EnableWow64FsRedirection (TRUE);