Windows: fix regression when language selected in the setup during fresh install and that caused VeraCrypt background task to be disabled.

This commit is contained in:
Mounir IDRASSI 2018-09-02 23:21:51 +02:00
parent 35dabf4b2c
commit d3060a97b6
No known key found for this signature in database
GPG Key ID: DD0C382D5FCFB8FC
4 changed files with 21 additions and 8 deletions

View File

@ -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 ())

View File

@ -163,6 +163,9 @@ extern BOOL MountVolumesAsSystemFavorite;
extern BOOL FavoriteMountOnArrivalInProgress;
extern BOOL MultipleMountOperationInProgress;
#ifndef SETUP
extern BOOL bLanguageSetInSetup;
#endif
enum tc_app_msg_ids
{

View File

@ -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 ();

View File

@ -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 ();