}
-/*
- * Displays the InstallDirectoryPage1.
- *
- * Next pages:
- * PrepareCopyPage (At once)
- *
- * SIDEEFFECTS
- * Inits DestinationRootPath
- * Inits DestinationPath
- * Inits DestinationArcPath
- *
- * RETURNS
- * Number of the next page.
- */
-static PAGE_NUMBER
-InstallDirectoryPage1(PWCHAR InstallDir,
- PDISKENTRY DiskEntry,
- PPARTENTRY PartEntry)
+static
+VOID
+BuildInstallPaths(PWCHAR InstallDir,
+ PDISKENTRY DiskEntry,
+ PPARTENTRY PartEntry)
{
WCHAR PathBuffer[MAX_PATH];
wcscat(PathBuffer, InstallDir);
RtlCreateUnicodeString(&DestinationArcPath, PathBuffer);
-
- return PREPARE_COPY_PAGE;
}
PartEntry = PartitionList->CurrentPartition;
if (IsUnattendedSetup)
- wcscpy(InstallDir, UnattendInstallationDirectory);
- else
- wcscpy(InstallDir, L"\\ReactOS");
+ {
+ if (!IsValidPath(UnattendInstallationDirectory))
+ {
+ /* FIXME: Log the error? */
+ return QUIT_PAGE;
+ }
+
+ BuildInstallPaths(UnattendInstallationDirectory,
+ DiskEntry,
+ PartEntry);
+
+ return PREPARE_COPY_PAGE;
+ }
+
+ wcscpy(InstallDir, L"\\ReactOS");
Length = wcslen(InstallDir);
Pos = Length;
CONSOLE_SetCursorType(TRUE, TRUE);
MUIDisplayPage(INSTALL_DIRECTORY_PAGE);
- // FIXME: Check the validity of the InstallDir; however what to do
- // if it is invalid but we are in unattended setup? (case of somebody
- // specified an invalid installation directory in the unattended file).
-
- if (IsUnattendedSetup)
- {
- return InstallDirectoryPage1(InstallDir,
- DiskEntry,
- PartEntry);
- }
-
while (TRUE)
{
CONSOLE_ConInKey(Ir);
* Check for the validity of the installation directory and pop up
* an error if it is not the case. Then the user can fix its input.
*/
- if (!IsValidPath(InstallDir, Length))
+ if (!IsValidPath(InstallDir))
{
MUIDisplayError(ERROR_DIRECTORY_NAME, Ir, POPUP_WAIT_ENTER);
return INSTALL_DIRECTORY_PAGE;
}
- return InstallDirectoryPage1(InstallDir,
- DiskEntry,
- PartEntry);
+
+ BuildInstallPaths(InstallDir,
+ DiskEntry,
+ PartEntry);
+
+ return PREPARE_COPY_PAGE;
}
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x08) /* BACKSPACE */
{