Author: hbelusca
Date: Sun Mar 8 04:09:23 2015
New Revision: 66604
URL:
http://svn.reactos.org/svn/reactos?rev=66604&view=rev
Log:
[USETUP]: Fix some problems with extra-backslashes in paths, and fix the support for the
setup directory "\" which means "the install directory" (i.e.
C:\ReactOS usually).
[BOOTDATA/VGAFONTS]: Install the vga fonts needed for the Blue driver. Better fix for
r57755 and r59547.
Modified:
trunk/reactos/base/setup/usetup/filequeue.c
trunk/reactos/base/setup/usetup/filesup.c
trunk/reactos/base/setup/usetup/interface/usetup.c
trunk/reactos/boot/bootdata/packages/reactos.dff.in
trunk/reactos/boot/bootdata/txtsetup.sif
Modified: trunk/reactos/base/setup/usetup/filequeue.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/filequeu…
==============================================================================
--- trunk/reactos/base/setup/usetup/filequeue.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/filequeue.c [iso-8859-1] Sun Mar 8 04:09:23 2015
@@ -38,7 +38,7 @@
struct _QUEUEENTRY *Prev;
struct _QUEUEENTRY *Next;
- PWSTR SourceCabinet; /* May be NULL if file is not in a cabinet */
+ PWSTR SourceCabinet; /* May be NULL if the file is not in a cabinet */
PWSTR SourceRootPath;
PWSTR SourcePath;
PWSTR SourceFilename;
@@ -215,6 +215,8 @@
if (SourcePath != NULL)
{
Length = wcslen(SourcePath);
+ if ((Length > 0) && (SourcePath[Length - 1] == L'\\'))
+ Length--;
Entry->SourcePath = (WCHAR*)RtlAllocateHeap(ProcessHeap,
0,
(Length + 1) * sizeof(WCHAR));
@@ -257,7 +259,7 @@
/* Copy target directory */
Length = wcslen(TargetDirectory);
- if (TargetDirectory[Length] == '\\')
+ if ((Length > 0) && (TargetDirectory[Length - 1] == L'\\'))
Length--;
Entry->TargetDirectory = (WCHAR*)RtlAllocateHeap(ProcessHeap,
0,
@@ -366,6 +368,7 @@
Entry = QueueHeader->CopyHead;
while (Entry != NULL)
{
+ /* Build the full source path */
wcscpy(FileSrcPath, Entry->SourceRootPath);
if (Entry->SourcePath != NULL)
wcscat(FileSrcPath, Entry->SourcePath);
@@ -374,24 +377,44 @@
/* Build the full target path */
wcscpy(FileDstPath, TargetRootPath);
- if (Entry->TargetDirectory[0] == L'\\')
- {
- wcscat(FileDstPath, Entry->TargetDirectory);
- }
- else
- {
+ if (Entry->TargetDirectory[0] == 0)
+ {
+ /* Installation path */
+
+ /* Add the installation path */
if (TargetPath != NULL)
{
if (TargetPath[0] != L'\\')
wcscat(FileDstPath, L"\\");
wcscat(FileDstPath, TargetPath);
}
+ }
+ else if (Entry->TargetDirectory[0] == L'\\')
+ {
+ /* Absolute path */
+ if (Entry->TargetDirectory[1] != 0)
+ wcscat(FileDstPath, Entry->TargetDirectory);
+ }
+ else // if (Entry->TargetDirectory[0] != L'\\')
+ {
+ /* Path relative to the installation path */
+
+ /* Add the installation path */
+ if (TargetPath != NULL)
+ {
+ if (TargetPath[0] != L'\\')
+ wcscat(FileDstPath, L"\\");
+ wcscat(FileDstPath, TargetPath);
+ }
wcscat(FileDstPath, L"\\");
wcscat(FileDstPath, Entry->TargetDirectory);
}
- /* Use only the destination path if the file is in a cabinet */
+ /*
+ * If the file is in a cabinet, use only the destination path.
+ * Otherwise possibly use a different target name.
+ */
if (Entry->SourceCabinet == NULL)
{
wcscat(FileDstPath, L"\\");
@@ -402,7 +425,7 @@
}
/* FIXME: Do it! */
- DPRINT("'%S' ==> '%S'\n", FileSrcPath,
FileDstPath);
+ DPRINT("Copy: '%S' ==> '%S'\n", FileSrcPath,
FileDstPath);
MsgHandler(Context,
SPFILENOTIFY_STARTCOPY,
Modified: trunk/reactos/base/setup/usetup/filesup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/filesup.…
==============================================================================
--- trunk/reactos/base/setup/usetup/filesup.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/filesup.c [iso-8859-1] Sun Mar 8 04:09:23 2015
@@ -327,7 +327,7 @@
0);
if (!NT_SUCCESS(Status))
{
- DPRINT1("NtCreateFile failed: %x\n", Status);
+ DPRINT1("NtCreateFile failed: %x, %wZ\n", Status, &FileName);
goto unmapsrcsec;
}
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] Sun Mar 8 04:09:23
2015
@@ -3121,7 +3121,8 @@
PWCHAR FileKeyValue;
PWCHAR DirKeyValue;
PWCHAR TargetFileName;
- WCHAR CompleteOrigFileName[512];
+ ULONG Length;
+ WCHAR CompleteOrigDirName[512];
if (SourceCabinet)
return AddSectionToCopyQueueCab(InfFile, L"SourceFiles", SourceCabinet,
DestinationPath, Ir);
@@ -3180,14 +3181,35 @@
break;
}
- wcscpy(CompleteOrigFileName, SourceRootDir.Buffer);
- wcscat(CompleteOrigFileName, L"\\");
- wcscat(CompleteOrigFileName, DirKeyValue);
+ if ((DirKeyValue[0] == 0) || (DirKeyValue[0] == L'\\' &&
DirKeyValue[1] == 0))
+ {
+ /* Installation path */
+ wcscpy(CompleteOrigDirName, SourceRootDir.Buffer);
+ }
+ else if (DirKeyValue[0] == L'\\')
+ {
+ /* Absolute path */
+ wcscpy(CompleteOrigDirName, DirKeyValue);
+ }
+ else // if (DirKeyValue[0] != L'\\')
+ {
+ /* Path relative to the installation path */
+ wcscpy(CompleteOrigDirName, SourceRootDir.Buffer);
+ wcscat(CompleteOrigDirName, L"\\");
+ wcscat(CompleteOrigDirName, DirKeyValue);
+ }
+
+ /* Remove trailing backslash */
+ Length = wcslen(CompleteOrigDirName);
+ if ((Length > 0) && (CompleteOrigDirName[Length - 1] ==
L'\\'))
+ {
+ CompleteOrigDirName[Length - 1] = 0;
+ }
if (!SetupQueueCopy(SetupFileQueue,
SourceCabinet,
SourceRootPath.Buffer,
- CompleteOrigFileName,
+ CompleteOrigDirName,
FileKeyName,
DirKeyValue,
TargetFileName))
@@ -3209,7 +3231,7 @@
WCHAR PathBuffer[MAX_PATH];
INFCONTEXT DirContext;
PWCHAR AdditionalSectionName = NULL;
- PWCHAR KeyValue;
+ PWCHAR DirKeyValue;
ULONG Length;
NTSTATUS Status;
@@ -3233,16 +3255,20 @@
/* Create directories */
/*
- * FIXME:
- * Install directories like '\reactos\test' are not handled yet.
- */
+ * FIXME:
+ * - Install directories like '\reactos\test' are not handled yet.
+ * - Copying files to DestinationRootPath should be done from within
+ * the SystemPartitionFiles section.
+ * At the moment we check whether we specify paths like '\foo' or
'\\' for that.
+ * For installing to DestinationPath specify just '\' .
+ */
/* Get destination path */
wcscpy(PathBuffer, DestinationPath.Buffer);
/* Remove trailing backslash */
Length = wcslen(PathBuffer);
- if ((Length > 0) && (PathBuffer[Length - 1] == '\\'))
+ if ((Length > 0) && (PathBuffer[Length - 1] == L'\\'))
{
PathBuffer[Length - 1] = 0;
}
@@ -3274,27 +3300,35 @@
/* Enumerate the directory values and create the subdirectories */
do
{
- if (!INF_GetData(&DirContext, NULL, &KeyValue))
+ if (!INF_GetData(&DirContext, NULL, &DirKeyValue))
{
DPRINT1("break\n");
break;
}
- if (KeyValue[0] == L'\\' && KeyValue[1] != 0)
- {
- DPRINT("Absolute Path: '%S'\n", KeyValue);
+ if ((DirKeyValue[0] == 0) || (DirKeyValue[0] == L'\\' &&
DirKeyValue[1] == 0))
+ {
+ /* Installation path */
+ DPRINT("InstallationPath: '%S'\n", DirKeyValue);
+
+ wcscpy(PathBuffer, DestinationPath.Buffer);
+
+ DPRINT("FullPath: '%S'\n", PathBuffer);
+ }
+ else if (DirKeyValue[0] == L'\\')
+ {
+ /* Absolute path */
+ DPRINT("Absolute Path: '%S'\n", DirKeyValue);
wcscpy(PathBuffer, DestinationRootPath.Buffer);
- wcscat(PathBuffer, KeyValue);
-
- DPRINT("FullPath: '%S'\n", PathBuffer);
- }
- else if (KeyValue[0] != L'\\')
- {
- DPRINT("RelativePath: '%S'\n", KeyValue);
- wcscpy(PathBuffer, DestinationPath.Buffer);
- wcscat(PathBuffer, L"\\");
- wcscat(PathBuffer, KeyValue);
+ wcscat(PathBuffer, DirKeyValue);
+
+ /* Remove trailing backslash */
+ Length = wcslen(PathBuffer);
+ if ((Length > 0) && (PathBuffer[Length - 1] == L'\\'))
+ {
+ PathBuffer[Length - 1] = 0;
+ }
DPRINT("FullPath: '%S'\n", PathBuffer);
@@ -3306,7 +3340,33 @@
return FALSE;
}
}
- } while (SetupFindNextLine (&DirContext, &DirContext));
+ else // if (DirKeyValue[0] != L'\\')
+ {
+ /* Path relative to the installation path */
+ DPRINT("RelativePath: '%S'\n", DirKeyValue);
+
+ wcscpy(PathBuffer, DestinationPath.Buffer);
+ wcscat(PathBuffer, L"\\");
+ wcscat(PathBuffer, DirKeyValue);
+
+ /* Remove trailing backslash */
+ Length = wcslen(PathBuffer);
+ if ((Length > 0) && (PathBuffer[Length - 1] == L'\\'))
+ {
+ PathBuffer[Length - 1] = 0;
+ }
+
+ DPRINT("FullPath: '%S'\n", PathBuffer);
+
+ Status = SetupCreateDirectory(PathBuffer);
+ if (!NT_SUCCESS(Status) && Status != STATUS_OBJECT_NAME_COLLISION)
+ {
+ DPRINT("Creating directory '%S' failed: Status =
0x%08lx", PathBuffer, Status);
+ MUIDisplayError(ERROR_CREATE_DIR, Ir, POPUP_WAIT_ENTER);
+ return FALSE;
+ }
+ }
+ } while (SetupFindNextLine(&DirContext, &DirContext));
return TRUE;
}
Modified: trunk/reactos/boot/bootdata/packages/reactos.dff.in
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
==============================================================================
--- trunk/reactos/boot/bootdata/packages/reactos.dff.in [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/packages/reactos.dff.in [iso-8859-1] Sun Mar 8 04:09:23
2015
@@ -13,11 +13,14 @@
[Version]
Signature = "$ReactOS$"
+; Directories relative to the installation directory.
+; For specifying absolute directories, use the SystemPartitionFiles section,
+; or use names starting with \.
[Directories]
1 = system32
2 = system32\drivers
3 = Fonts
-4 =
+4 = "\"
5 = system32\drivers\etc
6 = inf
7 = bin
Modified: trunk/reactos/boot/bootdata/txtsetup.sif
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/txtsetup.sif…
==============================================================================
--- trunk/reactos/boot/bootdata/txtsetup.sif [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/txtsetup.sif [iso-8859-1] Sun Mar 8 04:09:23 2015
@@ -1,6 +1,9 @@
[Version]
Signature = "$ReactOS$"
+; Directories relative to the installation directory.
+; For specifying absolute directories, use the SystemPartitionFiles section,
+; or use names starting with \.
[Directories]
; <directory_id> = <path>
1 = "\"
@@ -22,6 +25,7 @@
uniata.sys=,,,,,,x,,,,,,4
buslogic.sys=,,,,,,x,,,,,,4
blue.sys=,,,,,,x,,,,,,4
+vgafonts.cab=,,,,,,,,,,,,1
bootvid.dll=,,,,,,,,,,,,2
c_437.nls=,,,,,,,,,,,,2
c_1252.nls=,,,,,,,,,,,,2
@@ -63,6 +67,8 @@
wmilib.sys=,,,,,,,,,,,,4
ksecdd.sys=,,,,,,,,,,,,4
mountmgr.sys=,,,,,,x,,,,,,4
+
+[SystemPartitionFiles]
[HardwareIdsDatabase]
;*PNP0A00 = isapnp