mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:32:59 +00:00
[USETUP] Simplify the unattended code path in the install directory page and verify the unattended install path.
This commit is contained in:
parent
16daf6700a
commit
849fe9f4eb
3 changed files with 32 additions and 43 deletions
|
@ -133,10 +133,11 @@ DoesPathExist(
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
IsValidPath(
|
IsValidPath(
|
||||||
PWCHAR InstallDir,
|
PWCHAR InstallDir)
|
||||||
ULONG Length)
|
|
||||||
{
|
{
|
||||||
UINT i;
|
UINT i, Length;
|
||||||
|
|
||||||
|
Length = wcslen(InstallDir);
|
||||||
|
|
||||||
// TODO: Add check for 8.3 too.
|
// TODO: Add check for 8.3 too.
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,6 @@ DoesFileExist(
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
IsValidPath(
|
IsValidPath(
|
||||||
PWCHAR InstallDir,
|
PWCHAR InstallDir);
|
||||||
ULONG Length);
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -3257,22 +3257,9 @@ CheckFileSystemPage(PINPUT_RECORD Ir)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
static
|
||||||
* Displays the InstallDirectoryPage1.
|
VOID
|
||||||
*
|
BuildInstallPaths(PWCHAR InstallDir,
|
||||||
* 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,
|
PDISKENTRY DiskEntry,
|
||||||
PPARTENTRY PartEntry)
|
PPARTENTRY PartEntry)
|
||||||
{
|
{
|
||||||
|
@ -3313,8 +3300,6 @@ InstallDirectoryPage1(PWCHAR InstallDir,
|
||||||
|
|
||||||
wcscat(PathBuffer, InstallDir);
|
wcscat(PathBuffer, InstallDir);
|
||||||
RtlCreateUnicodeString(&DestinationArcPath, PathBuffer);
|
RtlCreateUnicodeString(&DestinationArcPath, PathBuffer);
|
||||||
|
|
||||||
return PREPARE_COPY_PAGE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3356,8 +3341,20 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
|
||||||
PartEntry = PartitionList->CurrentPartition;
|
PartEntry = PartitionList->CurrentPartition;
|
||||||
|
|
||||||
if (IsUnattendedSetup)
|
if (IsUnattendedSetup)
|
||||||
wcscpy(InstallDir, UnattendInstallationDirectory);
|
{
|
||||||
else
|
if (!IsValidPath(UnattendInstallationDirectory))
|
||||||
|
{
|
||||||
|
/* FIXME: Log the error? */
|
||||||
|
return QUIT_PAGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildInstallPaths(UnattendInstallationDirectory,
|
||||||
|
DiskEntry,
|
||||||
|
PartEntry);
|
||||||
|
|
||||||
|
return PREPARE_COPY_PAGE;
|
||||||
|
}
|
||||||
|
|
||||||
wcscpy(InstallDir, L"\\ReactOS");
|
wcscpy(InstallDir, L"\\ReactOS");
|
||||||
|
|
||||||
Length = wcslen(InstallDir);
|
Length = wcslen(InstallDir);
|
||||||
|
@ -3367,17 +3364,6 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
|
||||||
CONSOLE_SetCursorType(TRUE, TRUE);
|
CONSOLE_SetCursorType(TRUE, TRUE);
|
||||||
MUIDisplayPage(INSTALL_DIRECTORY_PAGE);
|
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)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
CONSOLE_ConInKey(Ir);
|
CONSOLE_ConInKey(Ir);
|
||||||
|
@ -3446,14 +3432,17 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
|
||||||
* Check for the validity of the installation directory and pop up
|
* 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.
|
* 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);
|
MUIDisplayError(ERROR_DIRECTORY_NAME, Ir, POPUP_WAIT_ENTER);
|
||||||
return INSTALL_DIRECTORY_PAGE;
|
return INSTALL_DIRECTORY_PAGE;
|
||||||
}
|
}
|
||||||
return InstallDirectoryPage1(InstallDir,
|
|
||||||
|
BuildInstallPaths(InstallDir,
|
||||||
DiskEntry,
|
DiskEntry,
|
||||||
PartEntry);
|
PartEntry);
|
||||||
|
|
||||||
|
return PREPARE_COPY_PAGE;
|
||||||
}
|
}
|
||||||
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x08) /* BACKSPACE */
|
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x08) /* BACKSPACE */
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue