Author: hbelusca
Date: Mon Sep 26 22:49:13 2016
New Revision: 72823

URL: http://svn.reactos.org/svn/reactos?rev=72823&view=rev
Log:
[USERINIT]: Usability commit: when in LiveCD mode, if we cannot start the shell 
or the installer, display again the main menu.

Modified:
    trunk/reactos/base/system/userinit/userinit.c

Modified: trunk/reactos/base/system/userinit/userinit.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/userinit/userinit.c?rev=72823&r1=72822&r2=72823&view=diff
==============================================================================
--- trunk/reactos/base/system/userinit/userinit.c       [iso-8859-1] (original)
+++ trunk/reactos/base/system/userinit/userinit.c       [iso-8859-1] Mon Sep 26 
22:49:13 2016
@@ -577,13 +577,18 @@
          IN LPWSTR lpszCmdLine,
          IN int nCmdShow)
 {
+    BOOL bIsLiveCD;
+    BOOL Success;
     STATE State;
 
     hInstance = hInst;
 
+    bIsLiveCD = IsLiveCD();
+
+Restart:
     SetUserSettings();
 
-    if (IsLiveCD())
+    if (bIsLiveCD)
     {
         State.NextPage = LOCALEPAGE;
         State.Run = SHELL;
@@ -594,20 +599,28 @@
         State.Run = SHELL;
     }
 
-    if (State.NextPage != DONE)
+    if (State.NextPage != DONE) // && bIsLiveCD
     {
         RunLiveCD(&State);
     }
 
     if (State.Run == SHELL)
     {
-        StartShell();
-        NotifyLogon();
+        Success = StartShell();
+        if (Success)
+            NotifyLogon();
     }
     else if (State.Run == INSTALLER)
     {
-        StartInstaller();
-    }
+        Success = StartInstaller();
+    }
+
+    /*
+     * In LiveCD mode, go back to the main menu if we failed
+     * to either start the shell or the installer.
+     */
+    if (bIsLiveCD && !Success)
+        goto Restart;
 
     return 0;
 }


Reply via email to