Do not hardcode cdrom directory

svn path=/trunk/; revision=29352
This commit is contained in:
Hervé Poussineau 2007-10-02 12:16:45 +00:00
parent 68955155b7
commit f649143b56
4 changed files with 19 additions and 10 deletions

View file

@ -35,7 +35,8 @@
NTSTATUS
GetSourcePaths(PUNICODE_STRING SourcePath,
PUNICODE_STRING SourceRootPath)
PUNICODE_STRING SourceRootPath,
PUNICODE_STRING SourceRootDir)
{
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING LinkName;
@ -73,17 +74,19 @@ GetSourcePaths(PUNICODE_STRING SourcePath,
if (NT_SUCCESS(Status))
{
RtlCreateUnicodeString(SourcePath,
SourceName.Buffer);
SourceName.Buffer);
/* strip trailing directory */
Ptr = wcsrchr(SourceName.Buffer, L'\\');
// if ((Ptr != NULL) &&
// (wcsicmp(Ptr, L"\\reactos") == 0))
if (Ptr != NULL)
*Ptr = 0;
if (Ptr)
RtlCreateUnicodeString(SourceRootDir, Ptr);
else
RtlCreateUnicodeString(SourceRootDir, L"");
if (Ptr != NULL)
*Ptr = 0;
RtlCreateUnicodeString(SourceRootPath,
SourceName.Buffer);
SourceName.Buffer);
}
NtClose(Handle);

View file

@ -29,7 +29,8 @@
NTSTATUS
GetSourcePaths(PUNICODE_STRING SourcePath,
PUNICODE_STRING SourceRootPath);
PUNICODE_STRING SourceRootPath,
PUNICODE_STRING SourceRootDir);
#endif /* __DRIVESUP_H__ */

View file

@ -74,6 +74,7 @@ typedef enum _PAGE_NUMBER
HANDLE ProcessHeap;
UNICODE_STRING SourceRootPath;
UNICODE_STRING SourceRootDir;
UNICODE_STRING SourcePath;
BOOLEAN IsUnattendedSetup = FALSE;
LONG UnattendDestinationDiskNumber;
@ -635,7 +636,8 @@ SetupStartPage(PINPUT_RECORD Ir)
/* Get the source path and source root path */
Status = GetSourcePaths(&SourcePath,
&SourceRootPath);
&SourceRootPath,
&SourceRootDir);
if (!NT_SUCCESS(Status))
{
CONSOLE_PrintTextXY(6, 15, "GetSourcePaths() failed (Status 0x%08lx)", Status);
@ -649,6 +651,7 @@ SetupStartPage(PINPUT_RECORD Ir)
{
CONSOLE_PrintTextXY(6, 15, "SourcePath: '%wZ'", &SourcePath);
CONSOLE_PrintTextXY(6, 16, "SourceRootPath: '%wZ'", &SourceRootPath);
CONSOLE_PrintTextXY(6, 17, "SourceRootDir: '%wZ'", &SourceRootDir);
}
#endif
@ -2692,7 +2695,7 @@ AddSectionToCopyQueue(HINF InfFile,
if (!SetupQueueCopy(SetupFileQueue,
SourceCabinet,
SourceRootPath.Buffer,
L"\\reactos",
SourceRootDir.Buffer,
FileKeyName,
DirKeyValue,
TargetFileName))
@ -3562,6 +3565,7 @@ RunUSetup(VOID)
/* Initialize global unicode strings */
RtlInitUnicodeString(&SourcePath, NULL);
RtlInitUnicodeString(&SourceRootPath, NULL);
RtlInitUnicodeString(&SourceRootDir, NULL);
RtlInitUnicodeString(&InstallPath, NULL);
RtlInitUnicodeString(&DestinationPath, NULL);
RtlInitUnicodeString(&DestinationArcPath, NULL);

View file

@ -74,6 +74,7 @@
extern HANDLE ProcessHeap;
extern UNICODE_STRING SourceRootPath;
extern UNICODE_STRING SourceRootDir;
extern UNICODE_STRING SourcePath;
extern BOOLEAN IsUnattendedSetup;