Author: ilardig
Date: Mon May 24 22:53:32 2010
New Revision: 47341
URL:
http://svn.reactos.org/svn/reactos?rev=47341&view=rev
Log:
[USETUP]
- Check for required minimum disk space eventually warn the user.
- Added Italian and Spanish warnings, the other languages need translation.
- Patch by R.T.Sivakumar modified by me.
See issue #3302 for more details.
Modified:
trunk/reactos/base/setup/usetup/errorcode.h
trunk/reactos/base/setup/usetup/interface/usetup.c
trunk/reactos/base/setup/usetup/lang/bg-BG.h
trunk/reactos/base/setup/usetup/lang/en-US.h
trunk/reactos/base/setup/usetup/lang/es-ES.h
trunk/reactos/base/setup/usetup/lang/et-EE.h
trunk/reactos/base/setup/usetup/lang/fr-FR.h
trunk/reactos/base/setup/usetup/lang/it-IT.h
trunk/reactos/base/setup/usetup/lang/ja-JP.h
trunk/reactos/base/setup/usetup/lang/lt-LT.h
trunk/reactos/base/setup/usetup/lang/nl-NL.h
trunk/reactos/base/setup/usetup/lang/pl-PL.h
trunk/reactos/base/setup/usetup/lang/ru-RU.h
trunk/reactos/base/setup/usetup/lang/sk-SK.h
trunk/reactos/base/setup/usetup/lang/sv-SE.h
trunk/reactos/base/setup/usetup/lang/uk-UA.h
Modified: trunk/reactos/base/setup/usetup/errorcode.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/errorcod…
==============================================================================
--- trunk/reactos/base/setup/usetup/errorcode.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/errorcode.h [iso-8859-1] Mon May 24 22:53:32 2010
@@ -65,6 +65,7 @@
ERROR_UPDATE_LOCALESETTINGS,
ERROR_ADDING_KBLAYOUTS,
ERROR_UPDATE_GEOID,
+ ERROR_INSUFFICIENT_DISKSPACE,
ERROR_LAST_ERROR_CODE
}ERROR_NUMBER;
Modified: trunk/reactos/base/setup/usetup/interface/usetup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
==============================================================================
--- trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] Mon May 24 22:53:32
2010
@@ -31,6 +31,9 @@
#define NDEBUG
#include <debug.h>
+/* required free disk space in MB */
+#define MINIMUMDISKSIZE 350
+
/* GLOBALS ******************************************************************/
HANDLE ProcessHeap;
@@ -1381,6 +1384,31 @@
return DISPLAY_SETTINGS_PAGE;
}
+static BOOL IsDiskSizeValid(PPARTENTRY PartEntry)
+{
+ ULONGLONG m;
+ /* check for unpartitioned space */
+ m = PartEntry->UnpartitionedLength;
+ m = (m + (1 << 19)) >> 20; /* in MBytes (rounded) */
+ if( m > MINIMUMDISKSIZE)
+ {
+ return TRUE;
+ }
+
+ // check for partitioned space
+ m = PartEntry->PartInfo[0].PartitionLength.QuadPart;
+ m = (m + (1 << 19)) >> 20; /* in MBytes (rounded) */
+ if( m < MINIMUMDISKSIZE)
+ {
+ /* partition is too small so ask for another partion */
+ DPRINT1("Partition too small");
+ return FALSE;
+ }
+ else
+ {
+ return TRUE;
+ }
+}
static PAGE_NUMBER
SelectPartitionPage(PINPUT_RECORD Ir)
@@ -1434,9 +1462,13 @@
{
if (AutoPartition)
{
- PPARTENTRY PartEntry = PartEntry = PartitionList->CurrentPartition;
+ PPARTENTRY PartEntry = PartitionList->CurrentPartition;
ULONG MaxSize = (PartEntry->UnpartitionedLength + (1 << 19))
>> 20; /* in MBytes (rounded) */
-
+ if(!IsDiskSizeValid(PartitionList->CurrentPartition))
+ {
+ MUIDisplayError(ERROR_INSUFFICIENT_DISKSPACE, Ir,
POPUP_WAIT_ANY_KEY);
+ return SELECT_PARTITION_PAGE; /* let the user select another
partition */
+ }
CreateNewPartition(PartitionList,
MaxSize,
TRUE);
@@ -1446,6 +1478,11 @@
}
else
{
+ if(!IsDiskSizeValid(PartitionList->CurrentPartition))
+ {
+ MUIDisplayError(ERROR_INSUFFICIENT_DISKSPACE, Ir, POPUP_WAIT_ANY_KEY);
+ return SELECT_PARTITION_PAGE; /* let the user select another partition
*/
+ }
return(SELECT_FILE_SYSTEM_PAGE);
}
}
@@ -1489,6 +1526,11 @@
}
else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_RETURN) /* ENTER */
{
+ if(!IsDiskSizeValid(PartitionList->CurrentPartition))
+ {
+ MUIDisplayError(ERROR_INSUFFICIENT_DISKSPACE, Ir, POPUP_WAIT_ANY_KEY);
+ return SELECT_PARTITION_PAGE; /* let the user select another partition
*/
+ }
if (PartitionList->CurrentPartition == NULL ||
PartitionList->CurrentPartition->Unpartitioned == TRUE)
{
Modified: trunk/reactos/base/setup/usetup/lang/bg-BG.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/bg-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/bg-BG.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/lang/bg-BG.h [iso-8859-1] Mon May 24 22:53:32 2010
@@ -1482,6 +1482,12 @@
//ERROR_ADDING_KBLAYOUTS,
"¥ãá¯¥è® ¤®¡ ¢ï¥ ª« ¢¨ âãà¨â¥ ¯®¤à¥¤¡¨ ¢ ॣ¨áâêà .\n"
"ENTER = १ ¯ã᪠¥ ª®¬¯îâêà "
+ },
+ {
+ //ERROR_INSUFFICIENT_DISKSPACE,
+ "Not enough free space in the selected partition.\n"
+ " * â¨á¥â¥ ª« ¢¨è, § ¤ ¯à®¤ê«¦¨â¥.",
+ NULL
},
{
//ERROR_UPDATE_GEOID,
Modified: trunk/reactos/base/setup/usetup/lang/en-US.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/en-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/en-US.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/lang/en-US.h [iso-8859-1] Mon May 24 22:53:32 2010
@@ -1475,6 +1475,12 @@
//ERROR_UPDATE_GEOID,
"Setup could not set the geo id.\n"
"ENTER = Reboot computer"
+ },
+ {
+ //ERROR_INSUFFICIENT_DISKSPACE,
+ "Not enough free space in the selected partition.\n"
+ " * Press any key to continue.",
+ NULL
},
{
NULL,
Modified: trunk/reactos/base/setup/usetup/lang/es-ES.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/es-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/es-ES.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/lang/es-ES.h [iso-8859-1] Mon May 24 22:53:32 2010
@@ -18,7 +18,7 @@
{
6,
8,
- "Selecci¢n de idioma",
+ "Selecci¢n del idioma",
TEXT_STYLE_NORMAL
},
{
@@ -1471,6 +1471,12 @@
//ERROR_ADDING_KBLAYOUTS,
"Setup failed to add keyboard layouts to registry.\n"
"ENTER = Reboot computer"
+ },
+ {
+ //ERROR_INSUFFICIENT_DISKSPACE,
+ "No hay suficiente espacio disponible en la partici¢n seleccionada.\n"
+ " * Presione una tecla para continuar.",
+ NULL
},
{
//ERROR_UPDATE_GEOID,
Modified: trunk/reactos/base/setup/usetup/lang/et-EE.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/et-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/et-EE.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/lang/et-EE.h [iso-8859-1] Mon May 24 22:53:32 2010
@@ -1467,6 +1467,12 @@
//ERROR_ADDING_KBLAYOUTS,
"Klaviatuuriasetusi ei ännestunud registrisse lisada.\n"
"ENTER = Taaskivita arvuti"
+ },
+ {
+ //ERROR_INSUFFICIENT_DISKSPACE,
+ "Not enough free space in the selected partition.\n"
+ " * Press any key to continue.",
+ NULL
},
{
//ERROR_UPDATE_GEOID,
Modified: trunk/reactos/base/setup/usetup/lang/fr-FR.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/fr-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/fr-FR.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/lang/fr-FR.h [iso-8859-1] Mon May 24 22:53:32 2010
@@ -1483,6 +1483,12 @@
//ERROR_ADDING_KBLAYOUTS,
"Setup failed to add keyboard layouts to registry.\n"
"ENTER = Reboot computer"
+ },
+ {
+ //ERROR_INSUFFICIENT_DISKSPACE,
+ "Not enough free space in the selected partition.\n"
+ " * Press any key to continue.",
+ NULL
},
{
//ERROR_UPDATE_GEOID,
Modified: trunk/reactos/base/setup/usetup/lang/it-IT.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/it-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/it-IT.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/lang/it-IT.h [iso-8859-1] Mon May 24 22:53:32 2010
@@ -1471,6 +1471,12 @@
//ERROR_ADDING_KBLAYOUTS,
"Impossibile aggiungere le nazionalit
di tastiera al registro.\n"
"INVIO = Riavviare il computer"
+ },
+ {
+ //ERROR_INSUFFICIENT_DISKSPACE,
+ "Lo spazio disponibile nella partizione selezionata
insufficiente.\n"
+ " * Premere un tasto qualsiasi per continuare.",
+ NULL
},
{
//ERROR_UPDATE_GEOID,
Modified: trunk/reactos/base/setup/usetup/lang/ja-JP.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/ja-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/ja-JP.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/lang/ja-JP.h [iso-8859-1] Mon May 24 22:53:32 2010
@@ -1476,6 +1476,12 @@
//ERROR_UPDATE_GEOID,
"¾¯Ä±¯ÌßÊ geo id ¦ ¾¯Ã² ÃÞ·Ï¾Ý ÃÞ¼À¡\n"
"ENTER = ºÝËß°ÀÉ »²·ÄÞ³"
+ },
+ {
+ //ERROR_INSUFFICIENT_DISKSPACE,
+ "Not enough free space in the selected partition.\n"
+ " * Press any key to continue.",
+ NULL
},
{
NULL,
Modified: trunk/reactos/base/setup/usetup/lang/lt-LT.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/lt-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/lt-LT.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/lang/lt-LT.h [iso-8859-1] Mon May 24 22:53:32 2010
@@ -1480,6 +1480,12 @@
//ERROR_ADDING_KBLAYOUTS,
"Setup failed to add keyboard layouts to registry.\n"
"ENTER = Reboot computer"
+ },
+ {
+ //ERROR_INSUFFICIENT_DISKSPACE,
+ "Not enough free space in the selected partition.\n"
+ " * Press any key to continue.",
+ NULL
},
{
//ERROR_UPDATE_GEOID,
Modified: trunk/reactos/base/setup/usetup/lang/nl-NL.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/nl-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/nl-NL.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/lang/nl-NL.h [iso-8859-1] Mon May 24 22:53:32 2010
@@ -1498,6 +1498,12 @@
//ERROR_ADDING_KBLAYOUTS,
"Setup kan de toetsenbord indelingen niet toevoegen aan de
registry.\n"
"ENTER = Reboot computer"
+ },
+ {
+ //ERROR_INSUFFICIENT_DISKSPACE,
+ "Not enough free space in the selected partition.\n"
+ " * Press any key to continue.",
+ NULL
},
{
//ERROR_UPDATE_GEOID,
Modified: trunk/reactos/base/setup/usetup/lang/pl-PL.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/pl-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/pl-PL.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/lang/pl-PL.h [iso-8859-1] Mon May 24 22:53:32 2010
@@ -1479,6 +1479,12 @@
//ERROR_ADDING_KBLAYOUTS,
"Instalator nie m¢g doda ukad¢w klawiatury do rejestru.\n"
"ENTER = Restart komputera"
+ },
+ {
+ //ERROR_INSUFFICIENT_DISKSPACE,
+ "Not enough free space in the selected partition.\n"
+ " * Press any key to continue.",
+ NULL
},
{
//ERROR_UPDATE_GEOID,
Modified: trunk/reactos/base/setup/usetup/lang/ru-RU.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/ru-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/ru-RU.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/lang/ru-RU.h [iso-8859-1] Mon May 24 22:53:32 2010
@@ -1471,6 +1471,12 @@
//ERROR_ADDING_KBLAYOUTS,
"Setup failed to add keyboard layouts to registry.\n"
"ENTER = Reboot computer"
+ },
+ {
+ //ERROR_INSUFFICIENT_DISKSPACE,
+ "Not enough free space in the selected partition.\n"
+ " * Press any key to continue.",
+ NULL
},
{
//ERROR_UPDATE_GEOID,
Modified: trunk/reactos/base/setup/usetup/lang/sk-SK.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/sk-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/sk-SK.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/lang/sk-SK.h [iso-8859-1] Mon May 24 22:53:32 2010
@@ -1481,6 +1481,12 @@
//ERROR_ADDING_KBLAYOUTS,
"Inçtal tor zlyhal pri prid van¡ rozlo§en¡ kl vesnice do registrov.\n"
"ENTER = Reçtart po¡taa"
+ },
+ {
+ //ERROR_INSUFFICIENT_DISKSPACE,
+ "Not enough free space in the selected partition.\n"
+ " * Press any key to continue.",
+ NULL
},
{
//ERROR_UPDATE_GEOID,
Modified: trunk/reactos/base/setup/usetup/lang/sv-SE.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/sv-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/sv-SE.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/lang/sv-SE.h [iso-8859-1] Mon May 24 22:53:32 2010
@@ -1471,6 +1471,12 @@
//ERROR_ADDING_KBLAYOUTS,
"Setup failed to add keyboard layouts to registry.\n"
"ENTER = Reboot computer"
+ },
+ {
+ //ERROR_INSUFFICIENT_DISKSPACE,
+ "Not enough free space in the selected partition.\n"
+ " * Press any key to continue.",
+ NULL
},
{
//ERROR_UPDATE_GEOID,
Modified: trunk/reactos/base/setup/usetup/lang/uk-UA.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/uk-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/uk-UA.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/lang/uk-UA.h [iso-8859-1] Mon May 24 22:53:32 2010
@@ -1477,6 +1477,12 @@
//ERROR_ADDING_KBLAYOUTS,
"¥ ¢¤ «®áì ¤®¤ ⨠஧ª« ¤ª¨ ª« ¢i âãਠ¤® à¥óáâàã.\n"
"ENTER = ¥à¥§ ¢ â ¦¨â¨ ª®¬¯'îâ¥à"
+ },
+ {
+ //ERROR_INSUFFICIENT_DISKSPACE,
+ "Not enough free space in the selected partition.\n"
+ " * Press any key to continue.",
+ NULL
},
{
//ERROR_UPDATE_GEOID,