[USETUP]
authorEric Kohl <eric.kohl@reactos.org>
Sat, 27 Dec 2014 12:33:59 +0000 (12:33 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 27 Dec 2014 12:33:59 +0000 (12:33 +0000)
- Re-enable the partition size check and display a warning if the install partition is too small.
- Update the required install partition size to 550MB.

svn path=/trunk/; revision=65847

27 files changed:
reactos/base/setup/usetup/errorcode.h
reactos/base/setup/usetup/interface/usetup.c
reactos/base/setup/usetup/lang/bg-BG.h
reactos/base/setup/usetup/lang/bn-BD.h
reactos/base/setup/usetup/lang/cs-CZ.h
reactos/base/setup/usetup/lang/de-DE.h
reactos/base/setup/usetup/lang/en-US.h
reactos/base/setup/usetup/lang/es-ES.h
reactos/base/setup/usetup/lang/et-EE.h
reactos/base/setup/usetup/lang/fr-FR.h
reactos/base/setup/usetup/lang/he-IL.h
reactos/base/setup/usetup/lang/it-IT.h
reactos/base/setup/usetup/lang/ja-JP.h
reactos/base/setup/usetup/lang/lt-LT.h
reactos/base/setup/usetup/lang/nl-NL.h
reactos/base/setup/usetup/lang/pl-PL.h
reactos/base/setup/usetup/lang/pt-BR.h
reactos/base/setup/usetup/lang/ro-RO.h
reactos/base/setup/usetup/lang/ru-RU.h
reactos/base/setup/usetup/lang/sk-SK.h
reactos/base/setup/usetup/lang/sq-AL.h
reactos/base/setup/usetup/lang/sv-SE.h
reactos/base/setup/usetup/lang/tr-TR.h
reactos/base/setup/usetup/lang/uk-UA.h
reactos/base/setup/usetup/mui.c
reactos/base/setup/usetup/mui.h
reactos/boot/bootdata/txtsetup.sif

index b845b35..2c8b943 100644 (file)
@@ -66,7 +66,7 @@ typedef enum
     ERROR_UPDATE_LOCALESETTINGS,
     ERROR_ADDING_KBLAYOUTS,
     ERROR_UPDATE_GEOID,
-    ERROR_INSUFFICIENT_DISKSPACE,
+    ERROR_INSUFFICIENT_PARTITION_SIZE,
     ERROR_PARTITION_TABLE_FULL,
     ERROR_ONLY_ONE_EXTENDED,
 
index 58976c4..5789b5b 100644 (file)
@@ -1425,28 +1425,18 @@ LayoutSettingsPage(PINPUT_RECORD Ir)
 }
 
 
-#if 0
 static BOOL
 IsDiskSizeValid(PPARTENTRY PartEntry)
 {
-    ULONGLONG m1, m2;
-
-    /*  check for unpartitioned space  */
-    m1 = PartEntry->UnpartitionedLength;
-    m1 = (m1 + (1 << 19)) >> 20;  /* in MBytes (rounded) */
+    ULONGLONG size;
 
-    if( m1 > RequiredPartitionDiskSpace)
-    {
-        return TRUE;
-    }
+    size = PartEntry->SectorCount.QuadPart * PartEntry->DiskEntry->BytesPerSector;
+    size = (size + 524288) / 1048576;  /* in MBytes */
 
-    /* check for partitioned space */
-    m2 = PartEntry->PartInfo[0].PartitionLength.QuadPart;
-    m2 = (m2 + (1 << 19)) >> 20;  /* in MBytes (rounded) */
-    if (m2 < RequiredPartitionDiskSpace)
+    if (size < RequiredPartitionDiskSpace)
     {
         /* partition is too small so ask for another partion */
-        DPRINT1("Partition is too small(unpartitioned: %I64u MB, partitioned: %I64u MB), required disk space is %lu MB\n", m1, m2, RequiredPartitionDiskSpace);
+        DPRINT1("Partition is too small (size: %I64u MB), required disk space is %lu MB\n", size, RequiredPartitionDiskSpace);
         return FALSE;
     }
     else
@@ -1454,7 +1444,6 @@ IsDiskSizeValid(PPARTENTRY PartEntry)
         return TRUE;
     }
 }
-#endif
 
 
 static PAGE_NUMBER
@@ -1513,16 +1502,16 @@ SelectPartitionPage(PINPUT_RECORD Ir)
         {
             if (AutoPartition)
             {
-#if 0
+                CreatePrimaryPartition(PartitionList,
+                                       PartitionList->CurrentPartition->SectorCount.QuadPart,
+                                       TRUE);
+
                 if (!IsDiskSizeValid(PartitionList->CurrentPartition))
                 {
-                    MUIDisplayError(ERROR_INSUFFICIENT_DISKSPACE, Ir, POPUP_WAIT_ANY_KEY);
+                    MUIDisplayError(ERROR_INSUFFICIENT_PARTITION_SIZE, Ir, POPUP_WAIT_ANY_KEY,
+                                    RequiredPartitionDiskSpace);
                     return SELECT_PARTITION_PAGE; /* let the user select another partition */
                 }
-#endif
-                CreatePrimaryPartition(PartitionList,
-                                       PartitionList->CurrentPartition->SectorCount.QuadPart,
-                                       TRUE);
 
                 DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter;
 
@@ -1531,13 +1520,13 @@ SelectPartitionPage(PINPUT_RECORD Ir)
         }
         else
         {
-#if 0
             if (!IsDiskSizeValid(PartitionList->CurrentPartition))
             {
-                MUIDisplayError(ERROR_INSUFFICIENT_DISKSPACE, Ir, POPUP_WAIT_ANY_KEY);
+                MUIDisplayError(ERROR_INSUFFICIENT_PARTITION_SIZE, Ir, POPUP_WAIT_ANY_KEY,
+                                RequiredPartitionDiskSpace);
                 return SELECT_PARTITION_PAGE; /* let the user select another partition */
             }
-#endif
+
             DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter;
 
             return SELECT_FILE_SYSTEM_PAGE;
@@ -1609,13 +1598,6 @@ SelectPartitionPage(PINPUT_RECORD Ir)
         }
         else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_RETURN)  /* ENTER */
         {
-#if 0
-            if (!IsDiskSizeValid(PartitionList->CurrentPartition))
-            {
-                MUIDisplayError(ERROR_INSUFFICIENT_DISKSPACE, Ir, POPUP_WAIT_ANY_KEY);
-                return SELECT_PARTITION_PAGE; /* let the user select another partition */
-            }
-#endif
             if (IsContainerPartition(PartitionList->CurrentPartition->PartitionType))
                 continue; //return SELECT_PARTITION_PAGE;
 
@@ -1627,6 +1609,13 @@ SelectPartitionPage(PINPUT_RECORD Ir)
                                        TRUE);
             }
 
+            if (!IsDiskSizeValid(PartitionList->CurrentPartition))
+            {
+                MUIDisplayError(ERROR_INSUFFICIENT_PARTITION_SIZE, Ir, POPUP_WAIT_ANY_KEY,
+                                RequiredPartitionDiskSpace);
+                return SELECT_PARTITION_PAGE; /* let the user select another partition */
+            }
+
             DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter;
 
             return SELECT_FILE_SYSTEM_PAGE;
index 7118904..23dc0bf 100644 (file)
@@ -1506,8 +1506,10 @@ MUI_ERROR bgBGErrorEntries[] =
         "ENTER = \8f१ ¯ã᪠­¥ ­  ª®¬¯îâêà "
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "\8d  ¨§¡à ­¨ï ¤ï« ­ï¬  ¤®áâ âêç­® á¢®¡®¤­® ¯à®áâà ­á⢮.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * \8d â¨á­¥â¥ ª« ¢¨è, §  ¤  ¯à®¤ê«¦¨â¥.",
         NULL
     },
index 8a6b39b..4218262 100644 (file)
@@ -1493,8 +1493,10 @@ MUI_ERROR bnBDErrorEntries[] =
         "ENTER = Reboot computer"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Not enough free space in the selected partition.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Press any key to continue.",
         NULL
     },
index 7574918..f9612b8 100644 (file)
@@ -1501,8 +1501,10 @@ MUI_ERROR csCZErrorEntries[] =
         "ENTER = Restartovat po\9f¡ta\9f"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Na zvolen\82m odd¡lu nen¡ dost voln\82ho m¡sta.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Pokra\9fujte stisknut¡m libovoln\82 kl vesy.",
         NULL
     },
index abab18f..7f1e3cc 100644 (file)
@@ -1497,9 +1497,10 @@ MUI_ERROR deDEErrorEntries[] =
         "EINGABETASTE = Computer neu starten"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Es ist nicht gen\81gend Speicherplatz auf der\n"
-        "gew\84hlten Partition vorhanden.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "Die gew\84hlten Partition ist nicht groá genug, um ReactOS zu installieren.\n"
+        "Die Installationspartition muss mindestens %lu MB groá sein.\n"
+        "\n"
         "  * Eine beliebige Taste zum Fortsetzen dr\81cken.",
         NULL
     },
index 5cf7020..4cdbb45 100644 (file)
@@ -1493,8 +1493,10 @@ MUI_ERROR enUSErrorEntries[] =
         "ENTER = Reboot computer"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Not enough free space in the selected partition.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Press any key to continue.",
         NULL
     },
index fca24ee..efc77c6 100644 (file)
@@ -1501,8 +1501,10 @@ MUI_ERROR esESErrorEntries[] =
         "ENTER = Reiniciar el equipo"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "No hay suficiente espacio disponible en la partici¢n seleccionada.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Presione una tecla para continuar.",
         NULL
     },
index 984af22..4104224 100644 (file)
@@ -1491,8 +1491,10 @@ MUI_ERROR etEEErrorEntries[] =
         "ENTER = Taask\84ivita arvuti"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Valitud partitsioonil pole piisavalt ruumi.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Vajuta suvalist klahvi, et j\84tkata.",
         NULL
     },
index 8a2b461..b83f658 100644 (file)
@@ -1506,8 +1506,10 @@ MUI_ERROR frFRErrorEntries[] =
         "ENTR\90E = Red\82marrer l'ordinateur"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Pas assez d'espace libre dans la partition s\82lectionn\82e.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Appuyer sur une touche pour continuer.",
         NULL
     },
index de05585..8e779f8 100644 (file)
@@ -1494,8 +1494,10 @@ MUI_ERROR heILErrorEntries[] =
         "ENTER = Reboot computer"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Not enough free space in the selected partition.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Press any key to continue.",
         NULL
     },
index d229bef..185f91d 100644 (file)
@@ -1495,8 +1495,10 @@ MUI_ERROR itITErrorEntries[] =
         "INVIO = Riavviare il computer"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Lo spazio disponibile nella partizione selezionata \8a insufficiente.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Premere un tasto qualsiasi per continuare.",
         NULL
     },
index 1d0b491..4d11d82 100644 (file)
@@ -1495,8 +1495,10 @@ MUI_ERROR jaJPErrorEntries[] =
         "ENTER = ºÝËß­°ÀÉ »²·ÄÞ³"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Not enough free space in the selected partition.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Press any key to continue.",
         NULL
     },
index bf3241c..f24c844 100644 (file)
@@ -1503,8 +1503,10 @@ MUI_ERROR ltLTErrorEntries[] =
         "ENTER = Reboot computer"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Not enough free space in the selected partition.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Press any key to continue.",
         NULL
     },
index 336d397..e1e9d45 100644 (file)
@@ -1539,8 +1539,10 @@ MUI_ERROR nlNLErrorEntries[] =
         "ENTER = Computer opnieuw opstarten"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Onvoldoende vrije ruimte in de geselecteerde partitie.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Druk op een toets om door te gaan.",
         NULL
     },
index 77d3c06..c212ae5 100644 (file)
@@ -1503,8 +1503,10 @@ MUI_ERROR plPLErrorEntries[] =
         "ENTER = Restart komputera"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Brak wystarczaj¥cej wolnej przestrzeni w wybranej partycji.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Naci\98nij dowolny klawisz, aby kontynuowa\86.",
         NULL
     },
index 6e70b9a..9b32c9a 100644 (file)
@@ -1531,8 +1531,10 @@ MUI_ERROR ptBRErrorEntries[] =
         "ENTER=Reiniciar"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "NÆo h  espa\87o suficiente na parti\87Æo selecionada.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Pressione qualquer tecla para continuar.",
         NULL
     },
index f98db12..d8049e7 100644 (file)
@@ -1570,9 +1570,10 @@ MUI_ERROR roROErrorEntries[] =
         "ENTER = Repornire calculator"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Pe partiîia selectatÇ nu existÇ suficient\n"
-        "spaîiu liber."
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Tastaîi pentru a continua.",
         NULL
     },
index 692489b..3c5e824 100644 (file)
@@ -1495,8 +1495,10 @@ MUI_ERROR ruRUErrorEntries[] =
         "ENTER = Reboot computer"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Not enough free space in the selected partition.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Press any key to continue.",
         NULL
     },
index ebd7a93..f030e28 100644 (file)
@@ -1505,8 +1505,10 @@ MUI_ERROR skSKErrorEntries[] =
         "ENTER = Reçtart po\9f¡ta\9fa"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Na zvolenej part¡cii nie je dostatok vo\96n\82ho miesta.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Pokra\9fujte stla\9fen¡m \96ubovo\96n\82ho kl vesu.",
         NULL
     },
index e8f0366..e340841 100644 (file)
@@ -1498,8 +1498,10 @@ MUI_ERROR sqALErrorEntries[] =
         "ENTER = Ristarto kompjuterin"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Jo mjaft hapesir\89 e lir\89 n\89 particionin e p\89rzgjedhur.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Shtypni nj\89 tast cfar\89do p\89r t\89 vazhduar.",
         NULL
     },
index 33f7eca..6f1f2fe 100644 (file)
@@ -1501,8 +1501,10 @@ MUI_ERROR svSEErrorEntries[] =
         "ENTER = Starta om datorn"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Inte tillr\84ckligt mycket fritt utrymme p\86 den valda partitionen.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * Tryck valfri tangent f\94r att forts\84tta.",
         NULL
     },
index 0ed4182..7bb8f98 100644 (file)
@@ -1481,8 +1481,10 @@ MUI_ERROR trTRErrorEntries[] =
         "Giri\9f = Bilgisayar\8d Yeniden Ba\9flat"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "Se\87ili b\94l\81mde yeterli bo\9f alan yok.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * S\81rd\81rmek i\87in bir d\81§meye bas\8dn\8dz.",
         NULL
     },
index 7293763..e83dd37 100644 (file)
@@ -1501,8 +1501,10 @@ MUI_ERROR ukUAErrorEntries[] =
         "ENTER = \8f¥à¥§ ¢ ­â ¦¨â¨ ª®¬¯'îâ¥à"
     },
     {
-        //ERROR_INSUFFICIENT_DISKSPACE,
-        "\8d¥¤®áâ â­ì® ¢i«ì­®£® ¬iáæï ­  ®¡à ­®¬ã à®§¤i«i.\n"
+        //ERROR_INSUFFICIENT_PARTITION_SIZE,
+        "The selected partition is not large enough to install ReactOS.\n"
+        "The install partition must have a size of at least %lu MB.\n"
+        "\n"
         "  * \8d â¨á­iâì ¡ã¤ì-ïªã ª« ¢ièã ¤«ï ¯à®¤®¢¦¥­­ï.",
         NULL
     },
index 1ebcf4a..0f8c4c1 100644 (file)
@@ -213,9 +213,12 @@ VOID
 MUIDisplayError(
     IN ULONG ErrorNum,
     OUT PINPUT_RECORD Ir,
-    IN ULONG WaitEvent)
+    IN ULONG WaitEvent,
+    ...)
 {
     const MUI_ERROR * entry;
+    CHAR Buffer[2048];
+    va_list ap;
 
     if (ErrorNum >= ERROR_LAST_ERROR_CODE)
     {
@@ -237,7 +240,11 @@ MUIDisplayError(
         return;
     }
 
-    PopupError(entry[ErrorNum].ErrorText,
+    va_start(ap, WaitEvent);
+    vsprintf(Buffer, entry[ErrorNum].ErrorText, ap);
+    va_end(ap);
+
+    PopupError(Buffer,
                entry[ErrorNum].ErrorStatus,
                Ir,
                WaitEvent);
index d8b0f1b..b950a0e 100644 (file)
@@ -69,7 +69,8 @@ VOID
 MUIDisplayError(
     ULONG ErrorNum,
     PINPUT_RECORD Ir,
-    ULONG WaitEvent);
+    ULONG WaitEvent,
+    ...);
 
 LPCWSTR
 MUIDefaultKeyboardLayout(VOID);
index a2050b8..6f18bfa 100644 (file)
@@ -13,7 +13,7 @@ Signature = "$ReactOS$"
 
 [DiskSpaceRequirements]
 ; Required free system partition disk space in MB
-FreeSysPartDiskSpace=350
+FreeSysPartDiskSpace=550
 
 [SourceDisksFiles]
 acpi.sys=,,,,,,,,,,,,4