From d3060a97b68636ee3143ec1c02bbaaf3f3549131 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 2 Sep 2018 23:21:51 +0200 Subject: Windows: fix regression when language selected in the setup during fresh install and that caused VeraCrypt background task to be disabled. --- src/Common/Dlgcode.c | 15 +++++++-------- src/Common/Dlgcode.h | 3 +++ src/Format/Tcformat.c | 5 +++++ src/Mount/Mount.c | 6 ++++++ 4 files changed, 21 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index 6157b189..f9b6f327 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -151,6 +151,10 @@ BOOL bMountFavoritesOnLogon = FALSE; BOOL bHistory = FALSE; +#ifndef SETUP +BOOL bLanguageSetInSetup = FALSE; +#endif + // Status of detection of hidden sectors (whole-system-drive encryption). // 0 - Unknown/undetermined/completed, 1: Detection is or was in progress (but did not complete e.g. due to system crash). int HiddenSectorDetectionStatus = 0; @@ -2877,9 +2881,6 @@ void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine) char langId[6]; InitCommonControlsPtr InitCommonControlsFn = NULL; wchar_t modPath[MAX_PATH]; -#ifndef SETUP - BOOL bLanguageSetInSetup = FALSE; -#endif GetModuleFileNameW (NULL, modPath, ARRAYSIZE (modPath)); @@ -3053,8 +3054,11 @@ void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine) } } +#ifndef VCEXPANDER // delete the registry key created by the installer (if any) DeleteRegistryKey (HKEY_CURRENT_USER, L"Software\\VeraCrypt"); +#endif + #endif if (langId[0] == 0) @@ -3077,11 +3081,6 @@ void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine) LoadLanguageFile (); #ifndef SETUP - // Save language to XML configuration file if it has been selected in the setup - // so that other VeraCrypt programs will pick it up - if (bLanguageSetInSetup) - SaveSettings (NULL); - // UAC elevation moniker cannot be used in portable mode. // A new instance of the application must be created with elevated privileges. if (IsNonInstallMode () && !IsAdmin () && IsUacSupported ()) diff --git a/src/Common/Dlgcode.h b/src/Common/Dlgcode.h index 974d2e05..00a49239 100644 --- a/src/Common/Dlgcode.h +++ b/src/Common/Dlgcode.h @@ -163,6 +163,9 @@ extern BOOL MountVolumesAsSystemFavorite; extern BOOL FavoriteMountOnArrivalInProgress; extern BOOL MultipleMountOperationInProgress; +#ifndef SETUP +extern BOOL bLanguageSetInSetup; +#endif enum tc_app_msg_ids { diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index ccdd682c..46ad2083 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c @@ -6060,6 +6060,11 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa LoadSettings (hwndDlg); + // Save language to XML configuration file if it has been selected in the setup + // so that other VeraCrypt programs will pick it up + if (bLanguageSetInSetup) + SaveSettings (hwndDlg); + LoadDefaultKeyFilesParam (); RestoreDefaultKeyFilesParam (); diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 7b42bc4b..a1543b61 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -6794,6 +6794,12 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa // General preferences LoadSettings (hwndDlg); + // Save language to XML configuration file if it has been selected in the setup + // so that other VeraCrypt programs will pick it up + if (bLanguageSetInSetup) + SaveSettings (hwndDlg); + + // Keyfiles LoadDefaultKeyFilesParam (); RestoreDefaultKeyFilesParam (); -- cgit v1.2.3