Author: greatlrd Date: Fri Jun 1 00:52:44 2007 New Revision: 26954
URL: http://svn.reactos.org/svn/reactos?rev=26954&view=rev Log: fixed hardcode string in syssetup by Pierre Schweitzer (email : heis_spiter at hotmail dot com) See issue #2247 for more details.
Modified: trunk/reactos/dll/win32/syssetup/lang/cs-CZ.rc trunk/reactos/dll/win32/syssetup/lang/de-DE.rc trunk/reactos/dll/win32/syssetup/lang/en-US.rc trunk/reactos/dll/win32/syssetup/lang/es-ES.rc trunk/reactos/dll/win32/syssetup/lang/fr-FR.rc trunk/reactos/dll/win32/syssetup/lang/hu-HU.rc trunk/reactos/dll/win32/syssetup/lang/id-ID.rc trunk/reactos/dll/win32/syssetup/lang/it-IT.rc trunk/reactos/dll/win32/syssetup/lang/ja-JP.rc trunk/reactos/dll/win32/syssetup/lang/nb-NO.rc trunk/reactos/dll/win32/syssetup/lang/nl-NL.rc trunk/reactos/dll/win32/syssetup/lang/pl-PL.rc trunk/reactos/dll/win32/syssetup/lang/uk-UA.rc trunk/reactos/dll/win32/syssetup/lang/zh-CN.rc trunk/reactos/dll/win32/syssetup/resource.h trunk/reactos/dll/win32/syssetup/wizard.c
Modified: trunk/reactos/dll/win32/syssetup/lang/cs-CZ.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/cs-... ============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/cs-CZ.rc (original) +++ trunk/reactos/dll/win32/syssetup/lang/cs-CZ.rc Fri Jun 1 00:52:44 2007 @@ -210,4 +210,15 @@ 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 */
Modified: trunk/reactos/dll/win32/syssetup/lang/de-DE.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/de-... ============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/de-DE.rc (original) +++ trunk/reactos/dll/win32/syssetup/lang/de-DE.rc Fri Jun 1 00:52:44 2007 @@ -235,4 +235,15 @@ 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 */
Modified: trunk/reactos/dll/win32/syssetup/lang/en-US.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/en-... ============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/en-US.rc (original) +++ trunk/reactos/dll/win32/syssetup/lang/en-US.rc Fri Jun 1 00:52:44 2007 @@ -236,4 +236,15 @@ 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 */
Modified: trunk/reactos/dll/win32/syssetup/lang/es-ES.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/es-... ============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/es-ES.rc (original) +++ trunk/reactos/dll/win32/syssetup/lang/es-ES.rc Fri Jun 1 00:52:44 2007 @@ -216,4 +216,15 @@ 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 */
Modified: trunk/reactos/dll/win32/syssetup/lang/fr-FR.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/fr-... ============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/fr-FR.rc (original) +++ trunk/reactos/dll/win32/syssetup/lang/fr-FR.rc Fri Jun 1 00:52:44 2007 @@ -236,4 +236,15 @@ 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 */
Modified: trunk/reactos/dll/win32/syssetup/lang/hu-HU.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/hu-... ============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/hu-HU.rc (original) +++ trunk/reactos/dll/win32/syssetup/lang/hu-HU.rc Fri Jun 1 00:52:44 2007 @@ -243,4 +243,15 @@ 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 */
Modified: trunk/reactos/dll/win32/syssetup/lang/id-ID.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/id-... ============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/id-ID.rc (original) +++ trunk/reactos/dll/win32/syssetup/lang/id-ID.rc Fri Jun 1 00:52:44 2007 @@ -234,4 +234,15 @@ 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 */
Modified: trunk/reactos/dll/win32/syssetup/lang/it-IT.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/it-... ============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/it-IT.rc (original) +++ trunk/reactos/dll/win32/syssetup/lang/it-IT.rc Fri Jun 1 00:52:44 2007 @@ -227,4 +227,15 @@ 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 */
Modified: trunk/reactos/dll/win32/syssetup/lang/ja-JP.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/ja-... ============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/ja-JP.rc (original) +++ trunk/reactos/dll/win32/syssetup/lang/ja-JP.rc Fri Jun 1 00:52:44 2007 @@ -214,4 +214,15 @@ 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 */
Modified: trunk/reactos/dll/win32/syssetup/lang/nb-NO.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/nb-... ============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/nb-NO.rc (original) +++ trunk/reactos/dll/win32/syssetup/lang/nb-NO.rc Fri Jun 1 00:52:44 2007 @@ -238,4 +238,15 @@ 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 */
Modified: trunk/reactos/dll/win32/syssetup/lang/nl-NL.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/nl-... ============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/nl-NL.rc (original) +++ trunk/reactos/dll/win32/syssetup/lang/nl-NL.rc Fri Jun 1 00:52:44 2007 @@ -214,4 +214,15 @@ 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 */
Modified: trunk/reactos/dll/win32/syssetup/lang/pl-PL.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/pl-... ============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/pl-PL.rc (original) +++ trunk/reactos/dll/win32/syssetup/lang/pl-PL.rc Fri Jun 1 00:52:44 2007 @@ -239,4 +239,15 @@ 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 */
Modified: trunk/reactos/dll/win32/syssetup/lang/uk-UA.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/uk-... ============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/uk-UA.rc (original) +++ trunk/reactos/dll/win32/syssetup/lang/uk-UA.rc Fri Jun 1 00:52:44 2007 @@ -224,4 +224,15 @@ 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 */
Modified: trunk/reactos/dll/win32/syssetup/lang/zh-CN.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/zh-... ============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/zh-CN.rc (original) +++ trunk/reactos/dll/win32/syssetup/lang/zh-CN.rc Fri Jun 1 00:52:44 2007 @@ -199,4 +199,14 @@ 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 */
Modified: trunk/reactos/dll/win32/syssetup/resource.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/resource... ============================================================================== --- trunk/reactos/dll/win32/syssetup/resource.h (original) +++ trunk/reactos/dll/win32/syssetup/resource.h Fri Jun 1 00:52:44 2007 @@ -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 */
Modified: trunk/reactos/dll/win32/syssetup/wizard.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/wizard.c... ============================================================================== --- trunk/reactos/dll/win32/syssetup/wizard.c (original) +++ trunk/reactos/dll/win32/syssetup/wizard.c Fri Jun 1 00:52:44 2007 @@ -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 heis_spiter@hotmail.com */
/* INCLUDES *****************************************************************/ @@ -446,6 +449,8 @@ { TCHAR OwnerName[51]; TCHAR OwnerOrganization[51]; + WCHAR Title[64]; + WCHAR ErrorName[256]; LPNMHDR lpnm;
switch (uMsg) @@ -486,10 +491,15 @@ 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 @@ 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,8 +570,16 @@ 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) { @@ -603,10 +629,12 @@ 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 @@ return TRUE; }
- /* Check admin passwords */ - GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 15); - GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 15); - if (_tcscmp(Password1, Password2)) + /* Check if admin passwords have been entered */ + if ((GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 15) == 0) || + (GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 15) == 0)) { - 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_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; } - - /* FIXME: check password for invalid characters */ + /* Check if passwords match */ + if (_tcscmp(Password1, Password2)) + { + 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; + } + + /* 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 @@ 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 @@ 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 @@ 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 @@ 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;