[SYSSETUP]
[reactos.git] / reactos / dll / win32 / syssetup / install.c
index 4eccb7f..ce5024a 100644 (file)
@@ -39,6 +39,7 @@ CMP_WaitNoPendingInstallEvents(DWORD dwTimeout);
 /* GLOBALS ******************************************************************/
 
 HINF hSysSetupInf = INVALID_HANDLE_VALUE;
 /* GLOBALS ******************************************************************/
 
 HINF hSysSetupInf = INVALID_HANDLE_VALUE;
+ADMIN_INFO AdminInfo;
 
 /* FUNCTIONS ****************************************************************/
 
 
 /* FUNCTIONS ****************************************************************/
 
@@ -905,6 +906,8 @@ InstallReactOS(HINSTANCE hInstance)
 
     InstallSecurity();
 
 
     InstallSecurity();
 
+    SetAutoAdminLogon();
+
     hShortcutsInf = SetupOpenInfFileW(L"shortcuts.inf",
                                       NULL,
                                       INF_STYLE_WIN4,
     hShortcutsInf = SetupOpenInfFileW(L"shortcuts.inf",
                                       NULL,
                                       INF_STYLE_WIN4,
@@ -933,7 +936,12 @@ InstallReactOS(HINSTANCE hInstance)
             HANDLE hToken;
             BOOL ret;
 
             HANDLE hToken;
             BOOL ret;
 
-            ret = LogonUserW(L"Administrator", L"", L"", LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, &hToken);
+            ret = LogonUserW(AdminInfo.Name,
+                             AdminInfo.Domain,
+                             AdminInfo.Password,
+                             LOGON32_LOGON_INTERACTIVE,
+                             LOGON32_PROVIDER_DEFAULT,
+                             &hToken);
             if (!ret)
             {
                 FatalError("LogonUserW() failed!");
             if (!ret)
             {
                 FatalError("LogonUserW() failed!");
@@ -959,6 +967,15 @@ InstallReactOS(HINSTANCE hInstance)
     LogItem(SYSSETUP_SEVERITY_INFORMATION, L"Installing ReactOS done");
     TerminateSetupActionLog();
 
     LogItem(SYSSETUP_SEVERITY_INFORMATION, L"Installing ReactOS done");
     TerminateSetupActionLog();
 
+    if (AdminInfo.Name != NULL)
+        RtlFreeHeap(RtlGetProcessHeap(), 0, AdminInfo.Name);
+
+    if (AdminInfo.Domain != NULL)
+        RtlFreeHeap(RtlGetProcessHeap(), 0, AdminInfo.Domain);
+
+    if (AdminInfo.Password != NULL)
+        RtlFreeHeap(RtlGetProcessHeap(), 0, AdminInfo.Password);
+
     /* Get shutdown privilege */
     if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token))
     {
     /* Get shutdown privilege */
     if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token))
     {