VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Dlgcode.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2018-08-12 01:20:20 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2018-08-12 18:30:21 +0200
commit652dfd43d603c33bc0be3bc0c849708d7e064a59 (patch)
tree4c158528097a43262d7e88388ec3bd9c84a9dee0 /src/Common/Dlgcode.c
parent012f7bfa93c31143be57cb01ac747f7961b2e534 (diff)
downloadVeraCrypt-652dfd43d603c33bc0be3bc0c849708d7e064a59.tar.gz
VeraCrypt-652dfd43d603c33bc0be3bc0c849708d7e064a59.zip
Windows Installer: implement language selection mechanism at the start of the installer to make easier for international users.
Diffstat (limited to 'src/Common/Dlgcode.c')
-rw-r--r--src/Common/Dlgcode.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index 4d3fdc78..3485eb0b 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -3031,6 +3031,22 @@ void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine)
// Language
langId[0] = 0;
SetPreferredLangId (ConfigReadString ("Language", "", langId, sizeof (langId)));
+
+#ifndef SETUP
+ if (langId[0] == 0)
+ {
+ // check if user selected a language during installation
+ WCHAR uiLang[6];
+ ReadRegistryString (L"Software\\VeraCrypt", L"SetupUILanguage", L"", uiLang, sizeof (uiLang));
+ if (0 < WideCharToMultiByte (CP_ACP, 0, uiLang, -1, langId, sizeof (langId), NULL, NULL))
+ {
+ SetPreferredLangId (langId);
+ }
+ }
+
+ // delete the registry key created by the installer (if any)
+ DeleteRegistryKey (HKEY_CURRENT_USER, L"Software\\VeraCrypt");
+#endif
if (langId[0] == 0)
{
@@ -5529,7 +5545,7 @@ static BOOL PerformBenchmark(HWND hBenchDlg, HWND hwndDlg)
a single digest.
*/
{
- BYTE *digest [MAX_DIGESTSIZE];
+ BYTE digest [MAX_DIGESTSIZE];
WHIRLPOOL_CTX wctx;
RMD160_CTX rctx;
sha512_ctx s2ctx;