From 4fc04f9002eddab0a9b2d8c28a5df4dc4eb25a6d Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Thu, 31 May 2007 20:52:44 +0000 Subject: [PATCH] fixed hardcode string in syssetup by Pierre Schweitzer (email : heis_spiter at hotmail dot com) See issue #2247 for more details. svn path=/trunk/; revision=26954 --- reactos/dll/win32/syssetup/lang/cs-CZ.rc | 11 ++ reactos/dll/win32/syssetup/lang/de-DE.rc | 11 ++ reactos/dll/win32/syssetup/lang/en-US.rc | 11 ++ reactos/dll/win32/syssetup/lang/es-ES.rc | 11 ++ reactos/dll/win32/syssetup/lang/fr-FR.rc | 11 ++ reactos/dll/win32/syssetup/lang/hu-HU.rc | 11 ++ reactos/dll/win32/syssetup/lang/id-ID.rc | 11 ++ reactos/dll/win32/syssetup/lang/it-IT.rc | 11 ++ reactos/dll/win32/syssetup/lang/ja-JP.rc | 11 ++ reactos/dll/win32/syssetup/lang/nb-NO.rc | 11 ++ reactos/dll/win32/syssetup/lang/nl-NL.rc | 11 ++ reactos/dll/win32/syssetup/lang/pl-PL.rc | 11 ++ reactos/dll/win32/syssetup/lang/uk-UA.rc | 11 ++ reactos/dll/win32/syssetup/lang/zh-CN.rc | 10 ++ reactos/dll/win32/syssetup/resource.h | 8 ++ reactos/dll/win32/syssetup/wizard.c | 137 +++++++++++++++++------ 16 files changed, 266 insertions(+), 32 deletions(-) diff --git a/reactos/dll/win32/syssetup/lang/cs-CZ.rc b/reactos/dll/win32/syssetup/lang/cs-CZ.rc index 2fd48b28d08..f38e40dab80 100644 --- a/reactos/dll/win32/syssetup/lang/cs-CZ.rc +++ b/reactos/dll/win32/syssetup/lang/cs-CZ.rc @@ -210,4 +210,15 @@ BEGIN IDS_SHORT_SOLITAIRE "Solitaire.lnk" IDS_SHORT_WINEMINE "WineMine.lnk" END + +STRINGTABLE +BEGIN + IDS_WZD_NAME "Setup cannot continue until you enter your name." + IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name." + IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer." + IDS_WZD_PASSWORDEMPTY "You must enter a password !" + IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again." + IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password." + IDS_WZD_LOCALTIME "Setup was unable to set the local time." +END /* EOF */ diff --git a/reactos/dll/win32/syssetup/lang/de-DE.rc b/reactos/dll/win32/syssetup/lang/de-DE.rc index 2b80f5ab08e..20e282a0ebb 100644 --- a/reactos/dll/win32/syssetup/lang/de-DE.rc +++ b/reactos/dll/win32/syssetup/lang/de-DE.rc @@ -235,4 +235,15 @@ BEGIN IDS_SHORT_SOLITAIRE "Solitaire.lnk" IDS_SHORT_WINEMINE "WineMine.lnk" END + +STRINGTABLE +BEGIN + IDS_WZD_NAME "Setup cannot continue until you enter your name." + IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name." + IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer." + IDS_WZD_PASSWORDEMPTY "You must enter a password !" + IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again." + IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password." + IDS_WZD_LOCALTIME "Setup was unable to set the local time." +END /* EOF */ diff --git a/reactos/dll/win32/syssetup/lang/en-US.rc b/reactos/dll/win32/syssetup/lang/en-US.rc index 404ff353a25..e653f04fb27 100644 --- a/reactos/dll/win32/syssetup/lang/en-US.rc +++ b/reactos/dll/win32/syssetup/lang/en-US.rc @@ -236,4 +236,15 @@ BEGIN IDS_SHORT_SOLITAIRE "Solitaire.lnk" IDS_SHORT_WINEMINE "WineMine.lnk" END + +STRINGTABLE +BEGIN + IDS_WZD_NAME "Setup cannot continue until you enter your name." + IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name." + IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer." + IDS_WZD_PASSWORDEMPTY "You must enter a password !" + IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again." + IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password." + IDS_WZD_LOCALTIME "Setup was unable to set the local time." +END /* EOF */ diff --git a/reactos/dll/win32/syssetup/lang/es-ES.rc b/reactos/dll/win32/syssetup/lang/es-ES.rc index f7482e93242..55a4570a7ec 100644 --- a/reactos/dll/win32/syssetup/lang/es-ES.rc +++ b/reactos/dll/win32/syssetup/lang/es-ES.rc @@ -216,4 +216,15 @@ BEGIN IDS_SHORT_SOLITAIRE "Solitaire.lnk" IDS_SHORT_WINEMINE "WineMine.lnk" END + +STRINGTABLE +BEGIN + IDS_WZD_NAME "Setup cannot continue until you enter your name." + IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name." + IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer." + IDS_WZD_PASSWORDEMPTY "You must enter a password !" + IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again." + IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password." + IDS_WZD_LOCALTIME "Setup was unable to set the local time." +END /* EOF */ diff --git a/reactos/dll/win32/syssetup/lang/fr-FR.rc b/reactos/dll/win32/syssetup/lang/fr-FR.rc index 281ba0a14c0..ea41a31b58b 100644 --- a/reactos/dll/win32/syssetup/lang/fr-FR.rc +++ b/reactos/dll/win32/syssetup/lang/fr-FR.rc @@ -236,4 +236,15 @@ BEGIN IDS_SHORT_SOLITAIRE "Solitaire.lnk" IDS_SHORT_WINEMINE "WineMine.lnk" END + +STRINGTABLE +BEGIN + IDS_WZD_NAME "L'installation ne peut pas continuer tant que vous n'avez pas entré votre nom." + IDS_WZD_SETCOMPUTERNAME "L'installation a échoué lors de la définition du nom de votre ordinateur." + IDS_WZD_COMPUTERNAME "L'installation ne peut continuer tant que vous n'avez pas entré le nom de votre ordinateur." + IDS_WZD_PASSWORDEMPTY "Vous devez entrer un mot de passe !" + IDS_WZD_PASSWORDMATCH "Les mots de passe entrés ne correspondent pas. Veuillez saisir une nouvelle fois le mot de passe désiré." + IDS_WZD_PASSWORDCHAR "Le mot de passe entré contient des caractères invalides. Veuillez saisir un mot de passe correct." + IDS_WZD_LOCALTIME "L'installation n'a pas réussi à définir l'heure locale." +END /* EOF */ diff --git a/reactos/dll/win32/syssetup/lang/hu-HU.rc b/reactos/dll/win32/syssetup/lang/hu-HU.rc index 6aaf5c9dcaf..a91d4088cb6 100644 --- a/reactos/dll/win32/syssetup/lang/hu-HU.rc +++ b/reactos/dll/win32/syssetup/lang/hu-HU.rc @@ -243,4 +243,15 @@ BEGIN IDS_SHORT_SOLITAIRE "Solitaire.lnk" IDS_SHORT_WINEMINE "WineMine.lnk" END + +STRINGTABLE +BEGIN + IDS_WZD_NAME "Setup cannot continue until you enter your name." + IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name." + IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer." + IDS_WZD_PASSWORDEMPTY "You must enter a password !" + IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again." + IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password." + IDS_WZD_LOCALTIME "Setup was unable to set the local time." +END /* EOF */ diff --git a/reactos/dll/win32/syssetup/lang/id-ID.rc b/reactos/dll/win32/syssetup/lang/id-ID.rc index fe9e22f7abb..9809b61cbfb 100644 --- a/reactos/dll/win32/syssetup/lang/id-ID.rc +++ b/reactos/dll/win32/syssetup/lang/id-ID.rc @@ -234,4 +234,15 @@ BEGIN IDS_SHORT_SOLITAIRE "Solitaire.lnk" IDS_SHORT_WINEMINE "WineMine.lnk" END + +STRINGTABLE +BEGIN + IDS_WZD_NAME "Setup cannot continue until you enter your name." + IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name." + IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer." + IDS_WZD_PASSWORDEMPTY "You must enter a password !" + IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again." + IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password." + IDS_WZD_LOCALTIME "Setup was unable to set the local time." +END /* EOF */ diff --git a/reactos/dll/win32/syssetup/lang/it-IT.rc b/reactos/dll/win32/syssetup/lang/it-IT.rc index a8efdb79f88..3badf9b67a9 100644 --- a/reactos/dll/win32/syssetup/lang/it-IT.rc +++ b/reactos/dll/win32/syssetup/lang/it-IT.rc @@ -227,4 +227,15 @@ BEGIN IDS_SHORT_SOLITAIRE "Solitaire.lnk" IDS_SHORT_WINEMINE "WineMine.lnk" END + +STRINGTABLE +BEGIN + IDS_WZD_NAME "Setup cannot continue until you enter your name." + IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name." + IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer." + IDS_WZD_PASSWORDEMPTY "You must enter a password !" + IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again." + IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password." + IDS_WZD_LOCALTIME "Setup was unable to set the local time." +END /* EOF */ diff --git a/reactos/dll/win32/syssetup/lang/ja-JP.rc b/reactos/dll/win32/syssetup/lang/ja-JP.rc index 8fb79bfefda..3daf9c45b4d 100644 --- a/reactos/dll/win32/syssetup/lang/ja-JP.rc +++ b/reactos/dll/win32/syssetup/lang/ja-JP.rc @@ -214,4 +214,15 @@ BEGIN IDS_SHORT_SOLITAIRE "Solitaire.lnk" IDS_SHORT_WINEMINE "WineMine.lnk" END + +STRINGTABLE +BEGIN + IDS_WZD_NAME "Setup cannot continue until you enter your name." + IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name." + IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer." + IDS_WZD_PASSWORDEMPTY "You must enter a password !" + IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again." + IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password." + IDS_WZD_LOCALTIME "Setup was unable to set the local time." +END /* EOF */ diff --git a/reactos/dll/win32/syssetup/lang/nb-NO.rc b/reactos/dll/win32/syssetup/lang/nb-NO.rc index 45fd2b4e360..963e9cb4c7e 100644 --- a/reactos/dll/win32/syssetup/lang/nb-NO.rc +++ b/reactos/dll/win32/syssetup/lang/nb-NO.rc @@ -238,4 +238,15 @@ BEGIN IDS_SHORT_SOLITAIRE "Solitaire.lnk" IDS_SHORT_WINEMINE "WineMine.lnk" END + +STRINGTABLE +BEGIN + IDS_WZD_NAME "Setup cannot continue until you enter your name." + IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name." + IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer." + IDS_WZD_PASSWORDEMPTY "You must enter a password !" + IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again." + IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password." + IDS_WZD_LOCALTIME "Setup was unable to set the local time." +END /* EOF */ diff --git a/reactos/dll/win32/syssetup/lang/nl-NL.rc b/reactos/dll/win32/syssetup/lang/nl-NL.rc index 04f69e82013..66469899540 100644 --- a/reactos/dll/win32/syssetup/lang/nl-NL.rc +++ b/reactos/dll/win32/syssetup/lang/nl-NL.rc @@ -214,4 +214,15 @@ BEGIN IDS_SHORT_SOLITAIRE "Solitaire.lnk" IDS_SHORT_WINEMINE "WineMine.lnk" END + +STRINGTABLE +BEGIN + IDS_WZD_NAME "Setup cannot continue until you enter your name." + IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name." + IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer." + IDS_WZD_PASSWORDEMPTY "You must enter a password !" + IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again." + IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password." + IDS_WZD_LOCALTIME "Setup was unable to set the local time." +END /* EOF */ diff --git a/reactos/dll/win32/syssetup/lang/pl-PL.rc b/reactos/dll/win32/syssetup/lang/pl-PL.rc index 8c2b0e674b5..e263afc158e 100644 --- a/reactos/dll/win32/syssetup/lang/pl-PL.rc +++ b/reactos/dll/win32/syssetup/lang/pl-PL.rc @@ -239,4 +239,15 @@ BEGIN IDS_SHORT_SOLITAIRE "RosPasjans.lnk" IDS_SHORT_WINEMINE "ROSaper.lnk" END + +STRINGTABLE +BEGIN + IDS_WZD_NAME "Setup cannot continue until you enter your name." + IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name." + IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer." + IDS_WZD_PASSWORDEMPTY "You must enter a password !" + IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again." + IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password." + IDS_WZD_LOCALTIME "Setup was unable to set the local time." +END /* EOF */ diff --git a/reactos/dll/win32/syssetup/lang/uk-UA.rc b/reactos/dll/win32/syssetup/lang/uk-UA.rc index 410d19c1cc3..2833fd888c3 100644 --- a/reactos/dll/win32/syssetup/lang/uk-UA.rc +++ b/reactos/dll/win32/syssetup/lang/uk-UA.rc @@ -224,4 +224,15 @@ BEGIN IDS_SHORT_SOLITAIRE "Solitaire.lnk" IDS_SHORT_WINEMINE "WineMine.lnk" END + +STRINGTABLE +BEGIN + IDS_WZD_NAME "Setup cannot continue until you enter your name." + IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name." + IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer." + IDS_WZD_PASSWORDEMPTY "You must enter a password !" + IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again." + IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password." + IDS_WZD_LOCALTIME "Setup was unable to set the local time." +END /* EOF */ diff --git a/reactos/dll/win32/syssetup/lang/zh-CN.rc b/reactos/dll/win32/syssetup/lang/zh-CN.rc index 55d1ca3ac0c..b132b145380 100644 --- a/reactos/dll/win32/syssetup/lang/zh-CN.rc +++ b/reactos/dll/win32/syssetup/lang/zh-CN.rc @@ -199,4 +199,14 @@ BEGIN IDS_REASON_UNKNOWN "" END +STRINGTABLE +BEGIN + IDS_WZD_NAME "Setup cannot continue until you enter your name." + IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name." + IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer." + IDS_WZD_PASSWORDEMPTY "You must enter a password !" + IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again." + IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password." + IDS_WZD_LOCALTIME "Setup was unable to set the local time." +END /* EOF */ diff --git a/reactos/dll/win32/syssetup/resource.h b/reactos/dll/win32/syssetup/resource.h index a6feb8d72a4..4515d7b78da 100644 --- a/reactos/dll/win32/syssetup/resource.h +++ b/reactos/dll/win32/syssetup/resource.h @@ -127,6 +127,14 @@ #define IDS_SHORT_SOLITAIRE 3411 #define IDS_SHORT_WINEMINE 3412 +#define IDS_WZD_NAME 3450 +#define IDS_WZD_SETCOMPUTERNAME 3451 +#define IDS_WZD_COMPUTERNAME 3452 +#define IDS_WZD_PASSWORDEMPTY 3453 +#define IDS_WZD_PASSWORDMATCH 3454 +#define IDS_WZD_PASSWORDCHAR 3455 +#define IDS_WZD_LOCALTIME 3456 + #define IDR_GPL 4000 #endif /* RESOURCE_H */ diff --git a/reactos/dll/win32/syssetup/wizard.c b/reactos/dll/win32/syssetup/wizard.c index 9c7acc21746..0821a8c8965 100644 --- a/reactos/dll/win32/syssetup/wizard.c +++ b/reactos/dll/win32/syssetup/wizard.c @@ -1,7 +1,10 @@ /* - * PROJECT: System setup - * LICENSE: GPL - See COPYING in the top level directory - * PROGRAMMER: Eric Kohl + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: System setup + * FILE: dll/win32/syssetup/wizard.c + * PURPOSE: GUI controls + * PROGRAMMERS: Eric Kohl + * Pierre Schweitzer */ /* INCLUDES *****************************************************************/ @@ -446,6 +449,8 @@ OwnerPageDlgProc(HWND hwndDlg, { TCHAR OwnerName[51]; TCHAR OwnerOrganization[51]; + WCHAR Title[64]; + WCHAR ErrorName[256]; LPNMHDR lpnm; switch (uMsg) @@ -486,10 +491,15 @@ OwnerPageDlgProc(HWND hwndDlg, OwnerName[0] = 0; if (GetDlgItemText(hwndDlg, IDC_OWNERNAME, OwnerName, 50) == 0) { - MessageBox(hwndDlg, - _T("Setup cannot continue until you enter your name."), - _T("ReactOS Setup"), - MB_ICONERROR | MB_OK); + if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, Title, sizeof(Title) / sizeof(Title[0]))) + { + wcscpy(Title, L"ReactOS Setup"); + } + if (0 == LoadStringW(hDllInstance, IDS_WZD_NAME, ErrorName, sizeof(ErrorName) / sizeof(ErrorName[0]))) + { + wcscpy(ErrorName, L"Setup cannot continue until you enter your name."); + } + MessageBox(hwndDlg, ErrorName, Title, MB_ICONERROR | MB_OK); SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME)); SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); @@ -527,12 +537,20 @@ static BOOL WriteComputerSettings(TCHAR * ComputerName, HWND hwndDlg) { + WCHAR Title[64]; + WCHAR ErrorComputerName[256]; if (!SetComputerName(ComputerName)) { - MessageBox(hwndDlg, - _T("Setup failed to set the computer name."), - _T("ReactOS Setup"), - MB_ICONERROR | MB_OK); + if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, Title, sizeof(Title) / sizeof(Title[0]))) + { + wcscpy(Title, L"ReactOS Setup"); + } + if (0 == LoadStringW(hDllInstance, IDS_WZD_SETCOMPUTERNAME, ErrorComputerName, + sizeof(ErrorComputerName) / sizeof(ErrorComputerName[0]))) + { + wcscpy(ErrorComputerName, L"Setup failed to set the computer name."); + } + MessageBox(hwndDlg, ErrorComputerName, Title, MB_ICONERROR | MB_OK); return FALSE; } @@ -552,9 +570,17 @@ ComputerPageDlgProc(HWND hwndDlg, TCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; TCHAR Password1[15]; TCHAR Password2[15]; + PWCHAR Password; + WCHAR Title[64]; + WCHAR EmptyComputerName[256], EmptyPassword[256], NotMatchPassword[256], WrongPassword[256]; DWORD Length; LPNMHDR lpnm; + if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, Title, sizeof(Title) / sizeof(Title[0]))) + { + wcscpy(Title, L"ReactOS Setup"); + } + switch (uMsg) { case WM_INITDIALOG: @@ -603,10 +629,12 @@ ComputerPageDlgProc(HWND hwndDlg, case PSN_WIZNEXT: if (GetDlgItemText(hwndDlg, IDC_COMPUTERNAME, ComputerName, 64) == 0) { - MessageBox(hwndDlg, - _T("Setup cannot continue until you enter the name of your computer."), - _T("ReactOS Setup"), - MB_ICONERROR | MB_OK); + if (0 == LoadStringW(hDllInstance, IDS_WZD_COMPUTERNAME, EmptyComputerName, + sizeof(EmptyComputerName) / sizeof(EmptyComputerName[0]))) + { + wcscpy(EmptyComputerName, L"Setup cannot continue until you enter the name of your computer."); + } + MessageBox(hwndDlg, EmptyComputerName, Title, MB_ICONERROR | MB_OK); SetFocus(GetDlgItem(hwndDlg, IDC_COMPUTERNAME)); SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); return TRUE; @@ -622,21 +650,50 @@ ComputerPageDlgProc(HWND hwndDlg, return TRUE; } - /* Check admin passwords */ - GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 15); - GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 15); + /* Check if admin passwords have been entered */ + if ((GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 15) == 0) || + (GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 15) == 0)) + { + if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDEMPTY, EmptyPassword, + sizeof(EmptyPassword) / sizeof(EmptyPassword[0]))) + { + wcscpy(EmptyPassword, L"You must enter a password !"); + } + MessageBox(hwndDlg, EmptyPassword, Title, MB_ICONERROR | MB_OK); + SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); + return TRUE; + } + /* Check if passwords match */ if (_tcscmp(Password1, Password2)) { - MessageBox(hwndDlg, - _T("The passwords you entered do not match. Please enter "\ - "the desired password again."), - _T("ReactOS Setup"), - MB_ICONERROR | MB_OK); + if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDMATCH, NotMatchPassword, + sizeof(NotMatchPassword) / sizeof(NotMatchPassword[0]))) + { + wcscpy(NotMatchPassword, L"The passwords you entered do not match. Please enter the desired password again."); + } + MessageBox(hwndDlg, NotMatchPassword, Title, MB_ICONERROR | MB_OK); SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); return TRUE; } - /* FIXME: check password for invalid characters */ + /* Check password for invalid characters */ + Password = (PWCHAR)Password1; + while (*Password) + { + if (!isprint(*Password)) + { + if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDCHAR, WrongPassword, + sizeof(WrongPassword) / sizeof(WrongPassword[0]))) + { + wcscpy(WrongPassword, L"The password you entered contains invalid characters. Please enter a cleaned password."); + } + MessageBox(hwndDlg, WrongPassword, Title, MB_ICONERROR | MB_OK); + SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); + return TRUE; + break; + } + Password++; + } /* FIXME: Set admin password */ break; @@ -1329,6 +1386,8 @@ SetSystemLocalTime(HWND hwnd, PSETUPDATA SetupData) static BOOL WriteDateTimeSettings(HWND hwndDlg, PSETUPDATA SetupData) { + WCHAR Title[64]; + WCHAR ErrorLocalTime[256]; GetLocalSystemTime(hwndDlg, SetupData); SetLocalTimeZone(GetDlgItem(hwndDlg, IDC_TIMEZONELIST), SetupData); @@ -1336,10 +1395,16 @@ WriteDateTimeSettings(HWND hwndDlg, PSETUPDATA SetupData) SetAutoDaylightInfo(GetDlgItem(hwndDlg, IDC_AUTODAYLIGHT)); if(!SetSystemLocalTime(hwndDlg, SetupData)) { - MessageBox(hwndDlg, - _T("Setup was unable to set the local time."), - _T("ReactOS Setup"), - MB_ICONWARNING | MB_OK); + if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, Title, sizeof(Title) / sizeof(Title[0]))) + { + wcscpy(Title, L"ReactOS Setup"); + } + if (0 == LoadStringW(hDllInstance, IDS_WZD_LOCALTIME, ErrorLocalTime, + sizeof(ErrorLocalTime) / sizeof(ErrorLocalTime[0]))) + { + wcscpy(ErrorLocalTime, L"Setup failed to set the computer name."); + } + MessageBox(hwndDlg, ErrorLocalTime, Title, MB_ICONWARNING | MB_OK); return FALSE; } @@ -1353,6 +1418,8 @@ DateTimePageDlgProc(HWND hwndDlg, LPARAM lParam) { PSETUPDATA SetupData; + WCHAR Title[64]; + WCHAR ErrorLocalTime[256]; /* Retrieve pointer to the global setup data */ SetupData = (PSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); @@ -1413,10 +1480,16 @@ DateTimePageDlgProc(HWND hwndDlg, SetAutoDaylightInfo(GetDlgItem(hwndDlg, IDC_AUTODAYLIGHT)); if(!SetSystemLocalTime(hwndDlg, SetupData)) { - MessageBox(hwndDlg, - _T("Setup was unable to set the local time."), - _T("ReactOS Setup"), - MB_ICONWARNING | MB_OK); + if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, Title, sizeof(Title) / sizeof(Title[0]))) + { + wcscpy(Title, L"ReactOS Setup"); + } + if (0 == LoadStringW(hDllInstance, IDS_WZD_LOCALTIME, ErrorLocalTime, + sizeof(ErrorLocalTime) / sizeof(ErrorLocalTime[0]))) + { + wcscpy(ErrorLocalTime, L"Setup failed to set the computer name."); + } + MessageBox(hwndDlg, ErrorLocalTime, Title, MB_ICONWARNING | MB_OK); } } break;