[USETUP]
authorEric Kohl <eric.kohl@reactos.org>
Mon, 24 May 2010 22:32:23 +0000 (22:32 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Mon, 24 May 2010 22:32:23 +0000 (22:32 +0000)
Make the required minimum disk space configurable from the txtsetup.sif file.

svn path=/trunk/; revision=47345

reactos/base/setup/usetup/interface/usetup.c
reactos/boot/bootdata/txtsetup.sif

index 6fc226a..63738b3 100644 (file)
@@ -31,8 +31,6 @@
 #define NDEBUG
 #include <debug.h>
 
-/* required free disk space in MB */
-#define MINIMUMDISKSIZE    350
 
 /* GLOBALS ******************************************************************/
 
@@ -84,6 +82,8 @@ static PGENERIC_LIST LanguageList = NULL;
 
 static LANGID LanguageId = 0;
 
+static ULONG RequiredPartitionDiskSpace = ~0;
+
 /* FUNCTIONS ****************************************************************/
 
 static VOID
@@ -723,6 +723,7 @@ SetupStartPage(PINPUT_RECORD Ir)
     UINT ErrorLine;
     ULONG ReturnSize;
     PGENERIC_LIST_ENTRY ListEntry;
+    INT IntValue;
 
     CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT));
 
@@ -803,6 +804,22 @@ SetupStartPage(PINPUT_RECORD Ir)
         return QUIT_PAGE;
     }
 
+    /* Open 'DiskSpaceRequirements' section */
+    if (!SetupFindFirstLineW(SetupInf, L"DiskSpaceRequirements", L"FreeSysPartDiskSpace", &Context))
+    {
+        MUIDisplayError(ERROR_CORRUPT_TXTSETUPSIF, Ir, POPUP_WAIT_ENTER);
+        return QUIT_PAGE;
+    }
+
+    /* Get the 'FreeSysPartDiskSpace' value */
+    if (!SetupGetIntField(&Context, 1, &IntValue))
+    {
+        MUIDisplayError(ERROR_CORRUPT_TXTSETUPSIF, Ir, POPUP_WAIT_ENTER);
+        return QUIT_PAGE;
+    }
+
+    RequiredPartitionDiskSpace = (ULONG)IntValue;
+
     /* Start PnP thread */
     if (hPnpThread != INVALID_HANDLE_VALUE)
     {
@@ -1390,7 +1407,7 @@ static BOOL IsDiskSizeValid(PPARTENTRY PartEntry)
     /*  check for unpartitioned space  */
     m = PartEntry->UnpartitionedLength; 
     m = (m + (1 << 19)) >> 20;  /* in MBytes (rounded) */
-    if( m > MINIMUMDISKSIZE) 
+    if( m > RequiredPartitionDiskSpace)
     {
         return TRUE;
     }
@@ -1398,7 +1415,7 @@ static BOOL IsDiskSizeValid(PPARTENTRY PartEntry)
     // check for partitioned space 
     m = PartEntry->PartInfo[0].PartitionLength.QuadPart;
     m = (m + (1 << 19)) >> 20;  /* in MBytes (rounded) */
-    if( m < MINIMUMDISKSIZE) 
+    if( m < RequiredPartitionDiskSpace)
     {
         /* partition is too small so ask for another partion */
         DPRINT1("Partition too small");
index 35f1c76..704228d 100644 (file)
@@ -11,6 +11,10 @@ Signature = "$ReactOS$"
 6 = Fonts
 7 = bin
 
+[DiskSpaceRequirements]
+; Required free system partition disk space in MB
+FreeSysPartDiskSpace=350
+
 [SourceDisksFiles]
 acpi.sys=,,,,,,,,,,,,4
 uniata.sys=,,,,,,x,,,,,,4