From: Eric Kohl Date: Sat, 18 Jan 2014 18:28:01 +0000 (+0000) Subject: [SYSSETUP] X-Git-Tag: ReactOS-0.3.16~192 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=a58d50de18d6bf83cdc955a463e1632a191bec9f [SYSSETUP] Set the commputer name and account domain name in unattended setup. svn path=/trunk/; revision=61679 --- diff --git a/reactos/dll/win32/syssetup/wizard.c b/reactos/dll/win32/syssetup/wizard.c index eeaada5f966..39c33631c6a 100644 --- a/reactos/dll/win32/syssetup/wizard.c +++ b/reactos/dll/win32/syssetup/wizard.c @@ -532,18 +532,22 @@ WriteComputerSettings(WCHAR * ComputerName, HWND hwndDlg) { WCHAR Title[64]; WCHAR ErrorComputerName[256]; + if (!SetComputerNameW(ComputerName)) { - 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]))) + if (hwndDlg != NULL) { - wcscpy(ErrorComputerName, L"Setup failed to set the computer name."); + 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."); + } + MessageBoxW(hwndDlg, ErrorComputerName, Title, MB_ICONERROR | MB_OK); } - MessageBoxW(hwndDlg, ErrorComputerName, Title, MB_ICONERROR | MB_OK); return FALSE; } @@ -617,6 +621,7 @@ ComputerPageDlgProc(HWND hwndDlg, SendMessage(GetDlgItem(hwndDlg, IDC_COMPUTERNAME), WM_SETTEXT, 0, (LPARAM)SetupData.ComputerName); SendMessage(GetDlgItem(hwndDlg, IDC_ADMINPASSWORD1), WM_SETTEXT, 0, (LPARAM)SetupData.AdminPassword); SendMessage(GetDlgItem(hwndDlg, IDC_ADMINPASSWORD2), WM_SETTEXT, 0, (LPARAM)SetupData.AdminPassword); + WriteComputerSettings(SetupData.ComputerName, NULL); SetAdministratorPassword(SetupData.AdminPassword); }