[USETUP]
authorCameron Gutman <aicommander@gmail.com>
Sun, 5 Sep 2010 17:09:18 +0000 (17:09 +0000)
committerCameron Gutman <aicommander@gmail.com>
Sun, 5 Sep 2010 17:09:18 +0000 (17:09 +0000)
- Add the option to write only the VBR so FreeLoader can easily be chain loaded by GRUB or another boot loader
- Dedicated to James Tabor :)

svn path=/trunk/; revision=48703

21 files changed:
reactos/base/setup/usetup/bootsup.c
reactos/base/setup/usetup/bootsup.h
reactos/base/setup/usetup/interface/usetup.c
reactos/base/setup/usetup/lang/bg-BG.h
reactos/base/setup/usetup/lang/cs-CZ.h
reactos/base/setup/usetup/lang/de-DE.h
reactos/base/setup/usetup/lang/el-GR.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/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/ru-RU.h
reactos/base/setup/usetup/lang/sk-SK.h
reactos/base/setup/usetup/lang/sv-SE.h
reactos/base/setup/usetup/lang/uk-UA.h
reactos/base/setup/usetup/usetup.h

index 7abbcb1..780d96a 100644 (file)
@@ -2156,6 +2156,28 @@ InstallFatBootcodeToPartition(PUNICODE_STRING SystemRootPath,
 #endif
 }
 
+NTSTATUS
+InstallVBRToPartition(PUNICODE_STRING SystemRootPath,
+                      PUNICODE_STRING SourceRootPath,
+                      PUNICODE_STRING DestinationArcPath,
+                      UCHAR PartitionType)
+{
+    if ((PartitionType == PARTITION_FAT_12) ||
+        (PartitionType == PARTITION_FAT_16) ||
+        (PartitionType == PARTITION_HUGE) ||
+        (PartitionType == PARTITION_XINT13) ||
+        (PartitionType == PARTITION_FAT32) ||
+        (PartitionType == PARTITION_FAT32_XINT13))
+    {
+        return InstallFatBootcodeToPartition(SystemRootPath,
+                                             SourceRootPath,
+                                             DestinationArcPath,
+                                             PartitionType);
+    }
+    
+    return STATUS_UNSUCCESSFUL;
+}
+
 
 NTSTATUS
 InstallFatBootcodeToFloppy(PUNICODE_STRING SourceRootPath,
index a0b012e..75c772a 100644 (file)
@@ -78,6 +78,12 @@ InstallFatBootcodeToPartition(PUNICODE_STRING SystemRootPath,
                              PUNICODE_STRING DestinationArcPath,
                              UCHAR PartitionType);
 
+NTSTATUS
+InstallVBRToPartition(PUNICODE_STRING SystemRootPath,
+                      PUNICODE_STRING SourceRootPath,
+                      PUNICODE_STRING DestinationArcPath,
+                      UCHAR PartitionType);
+
 NTSTATUS
 InstallFatBootcodeToFloppy(PUNICODE_STRING SourceRootPath,
                           PUNICODE_STRING DestinationArcPath);
index 5b5b6ea..2faad50 100644 (file)
@@ -3480,7 +3480,7 @@ BootLoaderPage(PINPUT_RECORD Ir)
     /* Unattended install on hdd? */
     if (IsUnattendedSetup && UnattendMBRInstallType == 2)
     {
-        return BOOT_LOADER_HARDDISK_PAGE;
+        return BOOT_LOADER_HARDDISK_MBR_PAGE;
     }
 
     MUIDisplayPage(BOOT_LOADER_PAGE);
@@ -3497,9 +3497,9 @@ BootLoaderPage(PINPUT_RECORD Ir)
 
             Line++;
             if (Line<12)
-                Line=14;
+                Line=15;
 
-            if (Line>14)
+            if (Line>15)
                 Line=12;
 
             CONSOLE_InvertTextXY(8, Line, 60, 1);
@@ -3511,9 +3511,9 @@ BootLoaderPage(PINPUT_RECORD Ir)
 
             Line--;
             if (Line<12)
-                Line=14;
+                Line=15;
 
-            if (Line>14)
+            if (Line>15)
                 Line=12;
 
             CONSOLE_InvertTextXY(8, Line, 60, 1);
@@ -3530,13 +3530,17 @@ BootLoaderPage(PINPUT_RECORD Ir)
         {
             if (Line == 12)
             {
-                return BOOT_LOADER_HARDDISK_PAGE;
+                return BOOT_LOADER_HARDDISK_MBR_PAGE;
             }
             else if (Line == 13)
             {
-                return BOOT_LOADER_FLOPPY_PAGE;
+                return BOOT_LOADER_HARDDISK_VBR_PAGE;
             }
             else if (Line == 14)
+            {
+                return BOOT_LOADER_FLOPPY_PAGE;
+            }
+            else if (Line == 15)
             {
                 return SUCCESS_PAGE;
             }
@@ -3592,9 +3596,30 @@ BootLoaderFloppyPage(PINPUT_RECORD Ir)
     return BOOT_LOADER_FLOPPY_PAGE;
 }
 
+static PAGE_NUMBER
+BootLoaderHarddiskVbrPage(PINPUT_RECORD Ir)
+{
+    UCHAR PartitionType;
+    NTSTATUS Status;
+    
+    PartitionType = PartitionList->ActiveBootPartition->
+                    PartInfo[PartitionList->ActiveBootPartitionNumber].PartitionType;
+    
+    Status = InstallVBRToPartition(&SystemRootPath,
+                                   &SourceRootPath,
+                                   &DestinationArcPath,
+                                   PartitionType);
+    if (!NT_SUCCESS(Status))
+    {
+        MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);
+        return QUIT_PAGE;
+    }
+    
+    return SUCCESS_PAGE;
+}
 
 static PAGE_NUMBER
-BootLoaderHarddiskPage(PINPUT_RECORD Ir)
+BootLoaderHarddiskMbrPage(PINPUT_RECORD Ir)
 {
     UCHAR PartitionType;
     NTSTATUS Status;
@@ -3604,24 +3629,12 @@ BootLoaderHarddiskPage(PINPUT_RECORD Ir)
     /* Step 1: Write the VBR */
     PartitionType = PartitionList->ActiveBootPartition->
         PartInfo[PartitionList->ActiveBootPartitionNumber].PartitionType;
-    if ((PartitionType == PARTITION_FAT_12) ||
-        (PartitionType == PARTITION_FAT_16) ||
-        (PartitionType == PARTITION_HUGE) ||
-        (PartitionType == PARTITION_XINT13) ||
-        (PartitionType == PARTITION_FAT32) ||
-        (PartitionType == PARTITION_FAT32_XINT13))
-    {
-        Status = InstallFatBootcodeToPartition(&SystemRootPath,
-                                               &SourceRootPath,
-                                               &DestinationArcPath,
-                                               PartitionType);
-        if (!NT_SUCCESS(Status))
-        {
-            MUIDisplayError(ERROR_INSTALL_BOOTCODE, Ir, POPUP_WAIT_ENTER);
-            return QUIT_PAGE;
-        }
-    }
-    else
+
+    Status = InstallVBRToPartition(&SystemRootPath,
+                                   &SourceRootPath,
+                                   &DestinationArcPath,
+                                   PartitionType);
+    if (!NT_SUCCESS(Status))
     {
         MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);
         return QUIT_PAGE;
@@ -3915,8 +3928,12 @@ RunUSetup(VOID)
                 Page = BootLoaderFloppyPage(&Ir);
                 break;
 
-            case BOOT_LOADER_HARDDISK_PAGE:
-                Page = BootLoaderHarddiskPage(&Ir);
+            case BOOT_LOADER_HARDDISK_MBR_PAGE:
+                Page = BootLoaderHarddiskMbrPage(&Ir);
+                break;
+                
+            case BOOT_LOADER_HARDDISK_VBR_PAGE:
+                Page = BootLoaderHarddiskVbrPage(&Ir);
                 break;
 
             /* Repair pages */
index b6b22fd..9e8de24 100644 (file)
@@ -995,18 +995,24 @@ static MUI_ENTRY bgBGBootLoaderEntries[] =
     {
         8,
         12,
-        "\91« £ ­¥ ­  § à¥¦¤ ç ­  â¢êन¨áª (¢ MBR).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "\91« £ ­¥ ­  § à¥¦¤ ç ­  ¤¨áª¥â .",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "\91« £ ­¥ ­  § à¥¦¤ ç ­  ¤¨áª¥â .",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "\84  ­¥ á¥ á« £  § à¥¦¤ ç.",
         TEXT_STYLE_NORMAL
     },
index 428b0f5..523cca7 100644 (file)
@@ -993,18 +993,24 @@ static MUI_ENTRY csCZBootLoaderEntries[] =
     {
         8,
         12,
-        "Nainstalovat zavad؟ na disk (MBR).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "Nainstalovat zavad؟ na disketu.",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "Nainstalovat zavad؟ na disketu.",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "Pýesko\9fit instalaci zavadØ\9fe.",
         TEXT_STYLE_NORMAL
     },
index 4686873..3a59372 100644 (file)
@@ -986,18 +986,24 @@ static MUI_ENTRY deDEBootLoaderEntries[] =
     {
         8,
         12,
-        "Boot-Loader auf der Festplatte installieren (Bootsektor).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "Boot-Loader auf einer Diskette installieren.",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "Boot-Loader auf einer Diskette installieren.",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "Boot-Loader nicht installieren.",
         TEXT_STYLE_NORMAL
     },
index 66de19a..16fc2d3 100644 (file)
@@ -1009,18 +1009,24 @@ static MUI_ENTRY elGRBootLoaderEntries[] =
     {
         8,
         12,
-        "\84\9a¡\98«á©«\98©\9e «¦¬ bootloader ©«¦ ©¡¢\9e¨æ \9bå©¡¦ (MBR).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "\84\9a¡\98«á©«\98©\9e «¦¬ bootloader ©\9c £ \98 \9b ©¡â«\98.",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "\84\9a¡\98«á©«\98©\9e «¦¬ bootloader ©\9c £ \98 \9b ©¡â«\98.",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "\8c\98 £\9e \9aå¤\9c  \9c\9a¡\98«á©«\98©\9e «¦¬ bootloader.",
         TEXT_STYLE_NORMAL
     },
index 9038002..909552f 100644 (file)
@@ -985,18 +985,24 @@ static MUI_ENTRY enUSBootLoaderEntries[] =
     {
         8,
         12,
-        "Install bootloader on the harddisk (bootsector).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "Install bootloader on a floppy disk.",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "Install bootloader on a floppy disk.",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "Skip install bootloader.",
         TEXT_STYLE_NORMAL
     },
index bc2fe13..1df3934 100644 (file)
@@ -992,18 +992,24 @@ static MUI_ENTRY esESBootLoaderEntries[] =
     {
         8,
         12,
-        "Instalar cargador de arranque en el disco duro (sector de boot).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "Instalar cargador de inicio en un disquete.",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "Instalar cargador de inicio en un disquete.",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "Omitir la instalaci¢n del cargador de arranque.",
         TEXT_STYLE_NORMAL
     },
index f0b7e8b..3c8a14b 100644 (file)
@@ -985,18 +985,24 @@ static MUI_ENTRY etEEBootLoaderEntries[] =
     {
         8,
         12,
-        "Paigalda alglaadur kävakettale (MBR).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "Paigalda alglaadur flopikettale.",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "Paigalda alglaadur flopikettale.",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "\8era paigalda alglaadurit.",
         TEXT_STYLE_NORMAL
     },
index aa3b3df..c9607c9 100644 (file)
@@ -998,18 +998,24 @@ static MUI_ENTRY frFRBootLoaderEntries[] =
     {
         8,
         12,
-        "Installer le chargeur de d\82marrage sur le disque dur (MBR).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "Installer le chargeur de d\82marrage sur une disquette.",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "Installer le chargeur de d\82marrage sur une disquette.",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "Ne pas installer le chargeur de d\82marrage.",
         TEXT_STYLE_NORMAL
     },
index 3b4ac56..6e3c4d8 100644 (file)
@@ -986,18 +986,24 @@ static MUI_ENTRY itITBootLoaderEntries[] =
     {
         8,
         12,
-        "Installazione del bootloader sul disco fisso (settore di avvio).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "Installazione del bootloader su un disco floppy.",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "Installazione del bootloader su un disco floppy.",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "Salta l'installazione del bootloader.",
         TEXT_STYLE_NORMAL
     },
index 03b6ec1..0db36ac 100644 (file)
@@ -986,18 +986,24 @@ static MUI_ENTRY jaJPBootLoaderEntries[] =
     {
         8,
         12,
-        "ÌÞ°ÄÛ°ÀÞ¦ Ê°ÄÞÃÞ¨½¸ (Ìްľ¸À)Æ ²Ý½Ä°Ù ½Ù¡",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "ÌÞ°ÄÛ°ÀÞ¦ ÌÛ¯Ëß° ÃÞ¨½¸Æ ²Ý½Ä°Ù ½Ù¡",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "ÌÞ°ÄÛ°ÀÞ¦ ÌÛ¯Ëß° ÃÞ¨½¸Æ ²Ý½Ä°Ù ½Ù¡",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "ÌÞ°ÄÛ°ÀÞÉ ²Ý½Ä°Ù¦ ½·¯Ìß ½Ù¡",
         TEXT_STYLE_NORMAL
     },
index 7020ebb..363f1f3 100644 (file)
@@ -995,18 +995,24 @@ static MUI_ENTRY ltLTBootLoaderEntries[] =
     {
         8,
         12,
-        "Install bootloader on the harddisk (MBR).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "Install bootloader on a floppy disk.",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "Install bootloader on a floppy disk.",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "Skip install bootloader.",
         TEXT_STYLE_NORMAL
     },
index 0141359..5ed50c6 100644 (file)
@@ -1012,18 +1012,24 @@ static MUI_ENTRY nlNLBootLoaderEntries[] =
     {
         8,
         12,
-        "Installeer de bootloader op de harde schijf (bootsector).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "Installeer de bootloader op een floppy disk.",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "Installeer de bootloader op een floppy disk.",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "Installeren bootloader overslaan.",
         TEXT_STYLE_NORMAL
     },
index de0a55f..6237e31 100644 (file)
@@ -994,18 +994,24 @@ static MUI_ENTRY plPLBootLoaderEntries[] =
     {
         8,
         12,
-        " Wgraj bootloader na dysk twardy (MBR).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        " Wgraj bootloader na dyskietk©.",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        " Wgraj bootloader na dyskietk©.",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         " Pomiä wgrywanie bootloadera.",
         TEXT_STYLE_NORMAL
     },
index b74d17b..268fec4 100644 (file)
@@ -986,18 +986,24 @@ static MUI_ENTRY ruRUBootLoaderEntries[] =
     {
         8,
         12,
-        "\93áâ ­®¢ª  ­  ¦¥á⪨© ¤¨áª (§ £à㧮ç­ë© á¥ªâ®à).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "\93áâ ­®¢ª  ­  £¨¡ª¨© ¤¨áª.",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "\93áâ ­®¢ª  ­  £¨¡ª¨© ¤¨áª.",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "\8d¥ ãáâ ­ ¢«¨¢ âì § £àã§ç¨ª.",
         TEXT_STYLE_NORMAL
     },
index abc2d73..73117a4 100644 (file)
@@ -993,18 +993,24 @@ static MUI_ENTRY skSKBootLoaderEntries[] =
     {
         8,
         12,
-        "Nainçtalova\9c zav dza\9f syst\82mu na pevnì disk (zav dzac¡ sektor).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "Nainçtalova\9c zav dza\9f syst\82mu na disketu.",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "Nainçtalova\9c zav dza\9f syst\82mu na disketu.",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "Presko\9fi\9c inçtal ciu zav dza\9fa syst\82mu.",
         TEXT_STYLE_NORMAL
     },
index 17b0fa5..debbfc2 100644 (file)
@@ -986,18 +986,24 @@ static MUI_ENTRY svSEBootLoaderEntries[] =
     {
         8,
         12,
-        "Install bootloader on the harddisk (MBR).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "Install bootloader on a floppy disk.",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "Install bootloader on a floppy disk.",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "Skip install bootloader.",
         TEXT_STYLE_NORMAL
     },
index f5da61e..fc97035 100644 (file)
@@ -991,18 +991,24 @@ static MUI_ENTRY ukUABootLoaderEntries[] =
     {
         8,
         12,
-        "\82áâ ­®¢¨â¨ bootloader ­  ¦®àá⪨© ¤¨áª (bootsector).",
+        "Install bootloader on the harddisk (MBR and VBR).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         13,
-        "\82áâ ­®¢¨â¨ bootloader ­  ¤¨áª¥âã.",
+        "Install bootloader on the harddisk (VBR only).",
         TEXT_STYLE_NORMAL
     },
     {
         8,
         14,
+        "\82áâ ­®¢¨â¨ bootloader ­  ¤¨áª¥âã.",
+        TEXT_STYLE_NORMAL
+    },
+    {
+        8,
+        15,
         "\8d¥ ¢áâ ­®¢«î¢ â¨ bootloader.",
         TEXT_STYLE_NORMAL
     },
index ff7cf87..bbb4212 100644 (file)
@@ -108,7 +108,8 @@ typedef enum _PAGE_NUMBER
   REGISTRY_PAGE,
   BOOT_LOADER_PAGE,
   BOOT_LOADER_FLOPPY_PAGE,
-  BOOT_LOADER_HARDDISK_PAGE,
+  BOOT_LOADER_HARDDISK_MBR_PAGE,
+  BOOT_LOADER_HARDDISK_VBR_PAGE,
 
   REPAIR_INTRO_PAGE,