From 806732f98e54b147974ac7c72cf93f5d0ccc74b4 Mon Sep 17 00:00:00 2001 From: Sylvain Petreolle Date: Mon, 27 Feb 2012 16:37:48 +0000 Subject: [PATCH] [USETUP] Fix installation directories set into unattend.inf, they were ignored and installed always into \ReactOS. svn path=/trunk/; revision=55884 --- reactos/base/setup/usetup/interface/usetup.c | 24 ++++---------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/reactos/base/setup/usetup/interface/usetup.c b/reactos/base/setup/usetup/interface/usetup.c index 9b49f89d328..c7b99d0cf45 100644 --- a/reactos/base/setup/usetup/interface/usetup.c +++ b/reactos/base/setup/usetup/interface/usetup.c @@ -506,10 +506,10 @@ CheckUnattendedSetup(VOID) UnattendDestinationPartitionNumber = IntValue; - /* Search for 'DestinationPartitionNumber' in the 'Unattend' section */ - if (!SetupFindFirstLineW(UnattendInf, L"Unattend", L"DestinationPartitionNumber", &Context)) + /* Search for 'InstallationDirectory' in the 'Unattend' section */ + if (!SetupFindFirstLineW(UnattendInf, L"Unattend", L"InstallationDirectory", &Context)) { - DPRINT("SetupFindFirstLine() failed for key 'DestinationPartitionNumber'\n"); + DPRINT("SetupFindFirstLine() failed for key 'InstallationDirectory'\n"); SetupCloseInfFile(UnattendInf); return; } @@ -2594,8 +2594,6 @@ InstallDirectoryPage(PINPUT_RECORD Ir) PDISKENTRY DiskEntry; PPARTENTRY PartEntry; WCHAR InstallDir[51]; - PWCHAR DefaultPath; - INFCONTEXT Context; ULONG Length; if (PartitionList == NULL || @@ -2609,22 +2607,10 @@ InstallDirectoryPage(PINPUT_RECORD Ir) DiskEntry = PartitionList->CurrentDisk; PartEntry = PartitionList->CurrentPartition; - /* Search for 'DefaultPath' in the 'SetupData' section */ - if (!SetupFindFirstLineW(SetupInf, L"SetupData", L"DefaultPath", &Context)) - { - MUIDisplayError(ERROR_FIND_SETUPDATA, Ir, POPUP_WAIT_ENTER); - return QUIT_PAGE; - } - - /* Read the 'DefaultPath' data */ - if (INF_GetData(&Context, NULL, &DefaultPath)) - { - wcscpy(InstallDir, DefaultPath); - } + if (IsUnattendedSetup) + wcscpy(InstallDir, UnattendInstallationDirectory); else - { wcscpy(InstallDir, L"\\ReactOS"); - } Length = wcslen(InstallDir); CONSOLE_SetInputTextXY(8, 11, 51, InstallDir);