@@ -2878,28 +2878,14 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
28782878 * of an invalid path, or we are in regular setup), display the UI and allow
28792879 * the user to specify a new installation path.
28802880 */
2881- if (( RepairUpdateFlag || IsUnattendedSetup ) && IsValidInstallDirectory ( InstallDir ) )
2881+ if (RepairUpdateFlag || IsUnattendedSetup )
28822882 {
2883- Status = InitDestinationPaths (& USetupData , InstallDir , InstallVolume );
2884- if (!NT_SUCCESS (Status ))
2885- {
2886- DPRINT1 ("InitDestinationPaths() failed: Status 0x%lx\n" , Status );
2887- MUIDisplayError (ERROR_NO_BUILD_PATH , Ir , POPUP_WAIT_ENTER );
2888- return QUIT_PAGE ;
2889- }
2890-
2891- /*
2892- * Check whether the user attempts to install ReactOS within the
2893- * installation source directory, or in a subdirectory thereof.
2894- * If so, fail with an error.
2895- */
2896- if (RtlPrefixUnicodeString (& USetupData .SourcePath , & USetupData .DestinationPath , TRUE))
2897- {
2898- MUIDisplayError (ERROR_SOURCE_DIR , Ir , POPUP_WAIT_ENTER );
2899- return INSTALL_DIRECTORY_PAGE ;
2900- }
2883+ /* Check for the validity of the installation directory and pop up
2884+ * an error if it is not the case. Then the user can fix it. */
2885+ if (IsValidInstallDirectory (InstallDir ))
2886+ goto InitInstallDir ;
29012887
2902- return PREPARE_COPY_PAGE ;
2888+ MUIDisplayError ( ERROR_DIRECTORY_NAME , Ir , POPUP_WAIT_ENTER ) ;
29032889 }
29042890
29052891 Length = wcslen (InstallDir );
@@ -2921,7 +2907,7 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
29212907
29222908 if (ConfirmQuit (Ir ))
29232909 return QUIT_PAGE ;
2924- break ;
2910+ return INSTALL_DIRECTORY_PAGE ;
29252911 }
29262912 else if ((Ir -> Event .KeyEvent .uChar .AsciiChar == 0x00 ) &&
29272913 (Ir -> Event .KeyEvent .wVirtualKeyCode == VK_DELETE )) /* DEL */
@@ -2980,36 +2966,13 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
29802966 {
29812967 CONSOLE_SetCursorType (TRUE, FALSE);
29822968
2983- /*
2984- * Check for the validity of the installation directory and pop up
2985- * an error if it is not the case. Then the user can fix its input.
2986- */
2987- if (!IsValidInstallDirectory (InstallDir ))
2988- {
2989- MUIDisplayError (ERROR_DIRECTORY_NAME , Ir , POPUP_WAIT_ENTER );
2990- return INSTALL_DIRECTORY_PAGE ;
2991- }
2992-
2993- Status = InitDestinationPaths (& USetupData , InstallDir , InstallVolume );
2994- if (!NT_SUCCESS (Status ))
2995- {
2996- DPRINT1 ("InitDestinationPaths() failed: Status 0x%lx\n" , Status );
2997- MUIDisplayError (ERROR_NO_BUILD_PATH , Ir , POPUP_WAIT_ENTER );
2998- return QUIT_PAGE ;
2999- }
3000-
3001- /*
3002- * Check whether the user attempts to install ReactOS within the
3003- * installation source directory, or in a subdirectory thereof.
3004- * If so, fail with an error.
3005- */
3006- if (RtlPrefixUnicodeString (& USetupData .SourcePath , & USetupData .DestinationPath , TRUE))
3007- {
3008- MUIDisplayError (ERROR_SOURCE_DIR , Ir , POPUP_WAIT_ENTER );
3009- return INSTALL_DIRECTORY_PAGE ;
3010- }
2969+ /* Check for the validity of the installation directory and pop up
2970+ * an error if it is not the case. Then the user can fix it. */
2971+ if (IsValidInstallDirectory (InstallDir ))
2972+ goto InitInstallDir ;
30112973
3012- return PREPARE_COPY_PAGE ;
2974+ MUIDisplayError (ERROR_DIRECTORY_NAME , Ir , POPUP_WAIT_ENTER );
2975+ return INSTALL_DIRECTORY_PAGE ;
30132976 }
30142977 else if (Ir -> Event .KeyEvent .uChar .AsciiChar == 0x08 ) /* BACKSPACE */
30152978 {
@@ -3051,7 +3014,27 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
30513014 }
30523015 }
30533016
3054- return INSTALL_DIRECTORY_PAGE ;
3017+ InitInstallDir :
3018+ Status = InitDestinationPaths (& USetupData , InstallDir , InstallVolume );
3019+ if (!NT_SUCCESS (Status ))
3020+ {
3021+ DPRINT1 ("InitDestinationPaths() failed: Status 0x%lx\n" , Status );
3022+ MUIDisplayError (ERROR_NO_BUILD_PATH , Ir , POPUP_WAIT_ENTER );
3023+ return QUIT_PAGE ;
3024+ }
3025+
3026+ /*
3027+ * Check whether the user attempts to install ReactOS within the
3028+ * installation source directory, or in a subdirectory thereof.
3029+ * If so, fail with an error.
3030+ */
3031+ if (RtlPrefixUnicodeString (& USetupData .SourcePath , & USetupData .DestinationPath , TRUE))
3032+ {
3033+ MUIDisplayError (ERROR_SOURCE_DIR , Ir , POPUP_WAIT_ENTER );
3034+ return INSTALL_DIRECTORY_PAGE ;
3035+ }
3036+
3037+ return PREPARE_COPY_PAGE ;
30553038}
30563039
30573040
0 commit comments