Author: ekohl
Date: Sat Jan 18 18:28:01 2014
New Revision: 61679
URL:
http://svn.reactos.org/svn/reactos?rev=61679&view=rev
Log:
[SYSSETUP]
Set the commputer name and account domain name in unattended setup.
Modified:
trunk/reactos/dll/win32/syssetup/wizard.c
Modified: trunk/reactos/dll/win32/syssetup/wizard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/wizard.…
==============================================================================
--- trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] Sat Jan 18 18:28:01 2014
@@ -532,18 +532,22 @@
{
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])))
- {
- wcscpy(ErrorComputerName, L"Setup failed to set the computer
name.");
- }
- MessageBoxW(hwndDlg, ErrorComputerName, Title, MB_ICONERROR | MB_OK);
+ if (hwndDlg != NULL)
+ {
+ 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);
+ }
return FALSE;
}
@@ -617,6 +621,7 @@
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);
}