From 3f6ca86312c30201e49956bbd74c20417307327e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 26 Sep 2016 22:49:13 +0000 Subject: [PATCH] [USERINIT]: Usability commit: when in LiveCD mode, if we cannot start the shell or the installer, display again the main menu. svn path=/trunk/; revision=72823 --- reactos/base/system/userinit/userinit.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/reactos/base/system/userinit/userinit.c b/reactos/base/system/userinit/userinit.c index d154f5b3236..1621e4b25bf 100644 --- a/reactos/base/system/userinit/userinit.c +++ b/reactos/base/system/userinit/userinit.c @@ -577,13 +577,18 @@ wWinMain(IN HINSTANCE hInst, 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,21 +599,29 @@ wWinMain(IN HINSTANCE hInst, 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; } -- 2.17.1