[ros-diffs] [janderwald] 23418: * make ReactOS textmode setup full-unattendable

janderwald at svn.reactos.org janderwald at svn.reactos.org
Wed Aug 2 20:58:08 CEST 2006


Author: janderwald
Date: Wed Aug  2 22:58:07 2006
New Revision: 23418

URL: http://svn.reactos.org/svn/reactos?rev=23418&view=rev
Log:
* make ReactOS textmode setup full-unattendable

Modified:
    trunk/reactos/base/setup/usetup/usetup.c

Modified: trunk/reactos/base/setup/usetup/usetup.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.c?rev=23418&r1=23417&r2=23418&view=diff
==============================================================================
--- trunk/reactos/base/setup/usetup/usetup.c (original)
+++ trunk/reactos/base/setup/usetup/usetup.c Wed Aug  2 22:58:07 2006
@@ -84,6 +84,7 @@
 BOOLEAN IsUnattendedSetup;
 LONG UnattendDestinationDiskNumber;
 LONG UnattendDestinationPartitionNumber;
+LONG UnattendMBRInstallType = -1;
 WCHAR UnattendInstallationDirectory[MAX_PATH];
 
 /* LOCALS *******************************************************************/
@@ -506,9 +507,28 @@
   wcscpy(UnattendInstallationDirectory, Value);
 
   InfFreeContext(Context);
+
+  IsUnattendedSetup = TRUE;
+
+  /* Search for 'MBRInstallType' in the 'Unattend' section */
+  if (!InfFindFirstLine(UnattendInf, L"Unattend", L"MBRInstallType", &Context))
+    {
+      DPRINT("InfFindFirstLine() failed for key 'MBRInstallType'\n");
+      InfFreeContext(Context);
+      InfCloseFile(UnattendInf);
+      return;
+    }
+  if (!InfGetIntField(Context, 0, &IntValue))
+    {
+      DPRINT("InfGetIntField() failed for key 'MBRInstallType'\n");
+      InfFreeContext(Context);
+      InfCloseFile(UnattendInf);
+      return;
+    }
+  UnattendMBRInstallType = IntValue;
+  InfFreeContext(Context);
+
   InfCloseFile(UnattendInf);
-
-  IsUnattendedSetup = TRUE;
 
   DPRINT("Running unattended setup\n");
 }
@@ -707,6 +727,12 @@
 
   if (IsUnattendedSetup)
     {
+      //TODO
+      //read options from inf
+      ComputerList = CreateComputerTypeList(SetupInf);
+      DisplayList = CreateDisplayDriverList(SetupInf);
+      KeyboardList = CreateKeyboardDriverList(SetupInf);
+      LayoutList = CreateKeyboardLayoutList(SetupInf);
       return INSTALL_INTRO_PAGE;
     }
 
@@ -3299,6 +3325,22 @@
       return BOOT_LOADER_FLOPPY_PAGE;
     }
 
+  if (IsUnattendedSetup)
+    {
+      if (UnattendMBRInstallType == 0) /* skip MBR installation */
+        {
+          return SUCCESS_PAGE;
+        }
+      else if (UnattendMBRInstallType == 1) /* install on floppy */
+        {
+          return BOOT_LOADER_FLOPPY_PAGE;
+        }
+      else if (UnattendMBRInstallType == 2) /* install on hdd */
+        {
+          return BOOT_LOADER_HARDDISK_PAGE;
+        }
+    }
+
   SetTextXY(6, 8, "Setup is installing the boot loader");
 
   SetTextXY(8, 12, "Install bootloader on the harddisk (MBR).");




More information about the Ros-diffs mailing list