VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Setup/Setup.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2018-08-13 12:52:52 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2018-08-13 13:20:07 (GMT)
commit17af27bc7fa82030084c3c3065f9516bfb88a899 (patch)
treeb09132ba99f571f93a1732bab31d7b759091670b /src/Setup/Setup.c
parent68fe28af429bcea4996e1fd57b8c4159ec076290 (diff)
downloadVeraCrypt-17af27bc7fa82030084c3c3065f9516bfb88a899.zip
VeraCrypt-17af27bc7fa82030084c3c3065f9516bfb88a899.tar.gz
Windows: code enhancements for language selection mechanism in the installer.
Diffstat (limited to 'src/Setup/Setup.c')
-rw-r--r--src/Setup/Setup.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c
index 986bc12..3c63836 100644
--- a/src/Setup/Setup.c
+++ b/src/Setup/Setup.c
@@ -2414,10 +2414,15 @@ static void UpdateSelectLanguageDialog (HWND hwndDlg)
HWND hLangList = GetDlgItem (hwndDlg, IDC_LANGUAGES_LIST);
LPARAM nIndex = SendMessage (hLangList, CB_GETCURSEL, 0, 0);
int resourceid = (int) SendMessage (hLangList, CB_GETITEMDATA, nIndex, 0);
+ BOOL bVal;
LoadLanguageFromResource (resourceid, TRUE, TRUE);
+ bVal = LocalizationActive;
+ LocalizationActive = TRUE;
LocalizeDialog (hwndDlg, "IDD_INSTL_DLG");
+ InvalidateRect (hwndDlg, NULL, FALSE);
+ LocalizationActive = bVal;
}
BOOL CALLBACK SelectLanguageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -2660,7 +2665,15 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz
{
if (!bDevm && !LocalizationActive && (nCurrentOS >= WIN_VISTA))
{
- DialogBoxParamW (hInstance, MAKEINTRESOURCEW (IDD_INSTALL_LANGUAGE), NULL, (DLGPROC) SelectLanguageDialogProc, (LPARAM) 0 );
+ BOOL bHasPreferredLanguage = (strlen (GetPreferredLangId ()) > 0)? TRUE : FALSE;
+ if ((IDCANCEL == DialogBoxParamW (hInstance, MAKEINTRESOURCEW (IDD_INSTALL_LANGUAGE), NULL, (DLGPROC) SelectLanguageDialogProc, (LPARAM) 0 ))
+ && !bHasPreferredLanguage
+ )
+ {
+ // Language dialog cancelled by user: exit the installer
+ FinalizeApp ();
+ exit (1);
+ }
}
/* Create the main dialog for install */