VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2018-08-22 23:59:51 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2018-08-24 00:49:52 +0200
commitf5a765e86088eb90c4392e43ad8a3c27bfa814cc (patch)
tree2ed9e57ad36f10f5e1cfcbafcd3bc6aa500390ab
parent9376bc8f5147c892769bddfc738563b9790d4f07 (diff)
downloadVeraCrypt-f5a765e86088eb90c4392e43ad8a3c27bfa814cc.tar.gz
VeraCrypt-f5a765e86088eb90c4392e43ad8a3c27bfa814cc.zip
Windows: fix language selected in the installer not used by "Create Volume" wizard until reboot or exiting VeraCrypt main process.
-rw-r--r--src/Common/Dlgcode.c9
-rw-r--r--src/Format/Tcformat.c2
-rw-r--r--src/Format/Tcformat.h2
3 files changed, 11 insertions, 2 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index 3fd6e768..ee598cf0 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -2877,6 +2877,9 @@ 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));
@@ -3046,6 +3049,7 @@ void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine)
if (0 < WideCharToMultiByte (CP_ACP, 0, uiLang, -1, langId, sizeof (langId), NULL, NULL))
{
SetPreferredLangId (langId);
+ bLanguageSetInSetup = TRUE;
}
}
@@ -3073,6 +3077,11 @@ 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/Format/Tcformat.c b/src/Format/Tcformat.c
index f2493b08..ccdd682c 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -821,7 +821,7 @@ static void LoadSettings (HWND hwndDlg)
LoadSettingsAndCheckModified (hwndDlg, FALSE, NULL, NULL);
}
-static void SaveSettings (HWND hwndDlg)
+void SaveSettings (HWND hwndDlg)
{
WaitCursor ();
diff --git a/src/Format/Tcformat.h b/src/Format/Tcformat.h
index caaf2c28..f9328afd 100644
--- a/src/Format/Tcformat.h
+++ b/src/Format/Tcformat.h
@@ -32,7 +32,7 @@ enum timer_ids
static void localcleanup ( void );
static void LoadSettings ( HWND hwndDlg );
-static void SaveSettings ( HWND hwndDlg );
+void SaveSettings ( HWND hwndDlg );
static void EndMainDlg ( HWND hwndDlg );
void ComboSelChangeEA ( HWND hwndDlg );
static void VerifySizeAndUpdate ( HWND hwndDlg , BOOL bUpdate );