* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* COPYRIGHT: See COPYING in the top level directory
static PGENERIC_LIST LayoutList = NULL;
static PGENERIC_LIST LanguageList = NULL;
+static LANGID LanguageId = 0;
+
/* FUNCTIONS ****************************************************************/
static VOID
UnattendInf = SetupOpenInfFileW(UnattendInfPath,
NULL,
INF_STYLE_WIN4,
+ LanguageId,
&ErrorLine);
if (UnattendInf == INVALID_HANDLE_VALUE)
if (LayoutList == NULL)
{
LayoutList = CreateKeyboardLayoutList(SetupInf, DefaultKBLayout);
+ if (LayoutList == NULL)
+ {
+ /* FIXME: Handle error! */
+ return;
+ }
}
ListEntry = GetFirstListEntry(LayoutList);
{
SelectedLanguageId = (PWCHAR)GetListEntryUserData(GetCurrentListEntry(LanguageList));
+ LanguageId = (LANGID)(wcstol(SelectedLanguageId, NULL, 16) & 0xFFFF);
+
if (wcscmp(SelectedLanguageId, DefaultLanguage))
{
UpdateKBLayout();
SetupInf = SetupOpenInfFileW(FileNameBuffer,
NULL,
INF_STYLE_WIN4,
+ LanguageId,
&ErrorLine);
if (SetupInf == INVALID_HANDLE_VALUE)
ListEntry = GetNextListEntry(ListEntry);
}
- SetConsoleCodePage();
+ SetConsoleCodePage();
- return INSTALL_INTRO_PAGE;
+ return INSTALL_INTRO_PAGE;
}
return LANGUAGE_PAGE;
else
{
/* Round-up by cylinder size */
- PartSize = ROUND_UP (PartSize * 1024 * 1024,
- DiskEntry->CylinderSize);
+ PartSize = (PartSize * 1024 * 1024 + DiskEntry->CylinderSize - 1) /
+ DiskEntry->CylinderSize * DiskEntry->CylinderSize;
/* But never get larger than the unpartitioned disk space */
if (PartSize > PartEntry->UnpartitionedLength)
CheckActiveBootPartition(PartitionList);
}
+ /* Install MBR if necessary */
+ if (DiskEntry->NoMbr &&
+ DiskEntry->BiosDiskNumber == 0)
+ {
+ wcscpy(PathBuffer, SourceRootPath.Buffer);
+ wcscat(PathBuffer, L"\\loader\\dosmbr.bin");
+
+ DPRINT("Install MBR bootcode: %S ==> %S\n",
+ PathBuffer, DestinationRootPath.Buffer);
+
+ /* Install MBR bootcode */
+ Status = InstallMbrBootCodeToDisk(PathBuffer, DestinationRootPath.Buffer);
+ if (!NT_SUCCESS (Status))
+ {
+ DPRINT1("InstallMbrBootCodeToDisk() failed (Status %lx)\n",
+ Status);
+ return FALSE;
+ }
+
+ DiskEntry->NoMbr = FALSE;
+ }
+
if (wcscmp(FileSystemList->Selected->FileSystem, L"FAT") == 0)
{
/* FIXME: Install boot code. This is a hack! */
InfFileSize,
(const CHAR*) NULL,
INF_STYLE_WIN4,
+ LanguageId,
&ErrorLine);
if (InfHandle == INVALID_HANDLE_VALUE)
FileCopyPage(PINPUT_RECORD Ir)
{
COPYCONTEXT CopyContext;
+ unsigned int mem_bar_width;
MUIDisplayPage(FILE_COPY_PAGE);
MUIGetString(STRING_SETUPCOPYINGFILES));
// fit memory bars to screen width, distribute them uniform
- unsigned int mem_bar_width = (xScreen - 26) / 5;
+ mem_bar_width = (xScreen - 26) / 5;
mem_bar_width -= mem_bar_width % 2; // make even
/* ATTENTION: The following progress bars are debug stuff, which should not be translated!! */
/* Create the paged pool progress bar */
CONSOLE_SetStatusText(MUIGetString(STRING_IMPORTFILE), File);
- if (!ImportRegistryFile(File, Section, Delete))
+ if (!ImportRegistryFile(File, Section, LanguageId, Delete))
{
DPRINT("Importing %S failed\n", File);
CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT));
- PartitionType = PartitionList->ActiveBootPartition->PartInfo[0].PartitionType;
+ PartitionType = PartitionList->ActiveBootPartition->
+ PartInfo[PartitionList->ActiveBootPartitionNumber].PartitionType;
+
+ if (IsUnattendedSetup)
+ {
+ if (UnattendMBRInstallType == 0) /* skip MBR installation */
+ {
+ return SUCCESS_PAGE;
+ }
+ else if (UnattendMBRInstallType == 1) /* install on floppy */
+ {
+ return BOOT_LOADER_FLOPPY_PAGE;
+ }
+ }
if (PartitionType == PARTITION_ENTRY_UNUSED)
{
return BOOT_LOADER_FLOPPY_PAGE;
}
- if (IsUnattendedSetup)
+ /* Unattended install on hdd? */
+ if (IsUnattendedSetup && UnattendMBRInstallType == 2)
{
- 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;
- }
+ return BOOT_LOADER_HARDDISK_PAGE;
}
MUIDisplayPage(BOOT_LOADER_PAGE);
UCHAR PartitionType;
NTSTATUS Status;
- PartitionType = PartitionList->ActiveBootPartition->PartInfo[0].PartitionType;
+ PartitionType = PartitionList->ActiveBootPartition->
+ PartInfo[PartitionList->ActiveBootPartitionNumber].PartitionType;
if ((PartitionType == PARTITION_FAT_12) ||
(PartitionType == PARTITION_FAT_16) ||
(PartitionType == PARTITION_HUGE) ||