mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Copy file dates of source file too.
Get default install directory from txtsetup.sif. svn path=/trunk/; revision=4116
This commit is contained in:
parent
3fad983cf2
commit
0be3b55ba5
2 changed files with 190 additions and 151 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: filesup.c,v 1.4 2003/01/17 13:18:15 ekohl Exp $
|
/* $Id: filesup.c,v 1.5 2003/02/08 00:19:32 ekohl Exp $
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS text-mode setup
|
* PROJECT: ReactOS text-mode setup
|
||||||
* FILE: subsys/system/usetup/filesup.c
|
* FILE: subsys/system/usetup/filesup.c
|
||||||
|
@ -48,15 +48,6 @@ CreateDirectory(PWCHAR DirectoryName)
|
||||||
RtlCreateUnicodeString(&PathName,
|
RtlCreateUnicodeString(&PathName,
|
||||||
DirectoryName);
|
DirectoryName);
|
||||||
|
|
||||||
#if 0
|
|
||||||
ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
|
|
||||||
ObjectAttributes.RootDirectory = NULL;
|
|
||||||
ObjectAttributes.ObjectName = &PathName;
|
|
||||||
ObjectAttributes.Attributes = OBJ_CASE_INSENSITIVE | OBJ_INHERIT;
|
|
||||||
ObjectAttributes.SecurityDescriptor = NULL;
|
|
||||||
ObjectAttributes.SecurityQualityOfService = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&PathName,
|
&PathName,
|
||||||
OBJ_CASE_INSENSITIVE | OBJ_INHERIT,
|
OBJ_CASE_INSENSITIVE | OBJ_INHERIT,
|
||||||
|
@ -238,14 +229,14 @@ CHECKPOINT1;
|
||||||
(PVOID *)&Buffer,
|
(PVOID *)&Buffer,
|
||||||
&RegionSize,
|
&RegionSize,
|
||||||
MEM_RELEASE);
|
MEM_RELEASE);
|
||||||
NtClose(FileHandleSource);
|
|
||||||
NtClose(FileHandleDest);
|
|
||||||
if (Status == STATUS_END_OF_FILE)
|
if (Status == STATUS_END_OF_FILE)
|
||||||
{
|
{
|
||||||
DPRINT("STATUS_END_OF_FILE\n");
|
DPRINT("STATUS_END_OF_FILE\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
CHECKPOINT1;
|
CHECKPOINT1;
|
||||||
|
NtClose(FileHandleSource);
|
||||||
|
NtClose(FileHandleDest);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,7 +264,22 @@ CHECKPOINT1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return(STATUS_SUCCESS);
|
|
||||||
|
/* Copy file date/time from source file */
|
||||||
|
Status = NtSetInformationFile(FileHandleDest,
|
||||||
|
&IoStatusBlock,
|
||||||
|
&FileBasic,
|
||||||
|
sizeof(FILE_BASIC_INFORMATION),
|
||||||
|
FileBasicInformation);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT("NtSetInformationFile() failed (Status %lx)\n", Status);
|
||||||
|
}
|
||||||
|
|
||||||
|
NtClose(FileHandleSource);
|
||||||
|
NtClose(FileHandleDest);
|
||||||
|
|
||||||
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -492,9 +492,9 @@ RepairIntroPage(PINPUT_RECORD Ir)
|
||||||
|
|
||||||
SetTextXY(6, 12, "The repair functions are not implemented yet.");
|
SetTextXY(6, 12, "The repair functions are not implemented yet.");
|
||||||
|
|
||||||
SetTextXY(8, 15, "\xf9 Press ESC to return to the main page.");
|
SetTextXY(8, 15, "\xfa Press ESC to return to the main page.");
|
||||||
|
|
||||||
SetTextXY(8, 17, "\xf9 Press ENTER to reboot your computer.");
|
SetTextXY(8, 17, "\xfa Press ENTER to reboot your computer.");
|
||||||
|
|
||||||
SetStatusText(" ESC = Main page ENTER = Reboot");
|
SetStatusText(" ESC = Main page ENTER = Reboot");
|
||||||
|
|
||||||
|
@ -531,13 +531,13 @@ IntroPage(PINPUT_RECORD Ir)
|
||||||
SetTextXY(6, 11, "This part of the setup copies the ReactOS Operating System to your");
|
SetTextXY(6, 11, "This part of the setup copies the ReactOS Operating System to your");
|
||||||
SetTextXY(6, 12, "computer and prepares the second part of the setup.");
|
SetTextXY(6, 12, "computer and prepares the second part of the setup.");
|
||||||
|
|
||||||
SetTextXY(8, 15, "\xf9 Press ENTER to install ReactOS.");
|
SetTextXY(8, 15, "\xfa Press ENTER to install ReactOS.");
|
||||||
|
|
||||||
SetTextXY(8, 17, "\xf9 Press E to start the emergency repair console.");
|
SetTextXY(8, 17, "\xfa Press E to start the emergency repair console.");
|
||||||
|
|
||||||
SetTextXY(8, 19, "\xf9 Press R to repair ReactOS.");
|
SetTextXY(8, 19, "\xfa Press R to repair ReactOS.");
|
||||||
|
|
||||||
SetTextXY(8, 21, "\xf9 Press F3 to quit without installing ReactOS.");
|
SetTextXY(8, 21, "\xfa Press F3 to quit without installing ReactOS.");
|
||||||
|
|
||||||
|
|
||||||
SetStatusText(" ENTER = Continue F3 = Quit");
|
SetStatusText(" ENTER = Continue F3 = Quit");
|
||||||
|
@ -587,9 +587,9 @@ InstallIntroPage(PINPUT_RECORD Ir)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SetTextXY(8, 21, "\xf9 Press ENTER to install ReactOS.");
|
SetTextXY(8, 21, "\xfa Press ENTER to install ReactOS.");
|
||||||
|
|
||||||
SetTextXY(8, 23, "\xf9 Press F3 to quit without installing ReactOS.");
|
SetTextXY(8, 23, "\xfa Press F3 to quit without installing ReactOS.");
|
||||||
|
|
||||||
|
|
||||||
SetStatusText(" ENTER = Continue F3 = Quit");
|
SetStatusText(" ENTER = Continue F3 = Quit");
|
||||||
|
@ -626,10 +626,10 @@ SelectPartitionPage(PINPUT_RECORD Ir)
|
||||||
SetTextXY(6, 8, "The list below shows existing partitions and unused disk");
|
SetTextXY(6, 8, "The list below shows existing partitions and unused disk");
|
||||||
SetTextXY(6, 9, "space for new partitions.");
|
SetTextXY(6, 9, "space for new partitions.");
|
||||||
|
|
||||||
SetTextXY(8, 11, "\xf9 Press UP or DOWN to select a list entry.");
|
SetTextXY(8, 11, "\xfa Press UP or DOWN to select a list entry.");
|
||||||
SetTextXY(8, 13, "\xf9 Press ENTER to install ReactOS onto the selected partition.");
|
SetTextXY(8, 13, "\xfa Press ENTER to install ReactOS onto the selected partition.");
|
||||||
SetTextXY(8, 15, "\xf9 Press C to create a new partition.");
|
SetTextXY(8, 15, "\xfa Press C to create a new partition.");
|
||||||
SetTextXY(8, 17, "\xf9 Press D to delete an existing partition.");
|
SetTextXY(8, 17, "\xfa Press D to delete an existing partition.");
|
||||||
|
|
||||||
SetStatusText(" Please wait...");
|
SetStatusText(" Please wait...");
|
||||||
|
|
||||||
|
@ -789,9 +789,9 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
|
||||||
|
|
||||||
SetTextXY(6, 17, "Select a file system for the partition from the list below.");
|
SetTextXY(6, 17, "Select a file system for the partition from the list below.");
|
||||||
|
|
||||||
SetTextXY(8, 19, "\xf9 Press UP or DOWN to select a file system.");
|
SetTextXY(8, 19, "\xfa Press UP or DOWN to select a file system.");
|
||||||
SetTextXY(8, 21, "\xf9 Press ENTER to format the partition.");
|
SetTextXY(8, 21, "\xfa Press ENTER to format the partition.");
|
||||||
SetTextXY(8, 23, "\xf9 Press ESC to select another partition.");
|
SetTextXY(8, 23, "\xfa Press ESC to select another partition.");
|
||||||
|
|
||||||
/* FIXME: use a real list later */
|
/* FIXME: use a real list later */
|
||||||
SetInvertedTextXY(6, 26, " Keep current file system (no changes) ");
|
SetInvertedTextXY(6, 26, " Keep current file system (no changes) ");
|
||||||
|
@ -861,23 +861,56 @@ CheckFileSystemPage(PINPUT_RECORD Ir)
|
||||||
static ULONG
|
static ULONG
|
||||||
InstallDirectoryPage(PINPUT_RECORD Ir)
|
InstallDirectoryPage(PINPUT_RECORD Ir)
|
||||||
{
|
{
|
||||||
|
PINICACHESECTION Section;
|
||||||
WCHAR PathBuffer[MAX_PATH];
|
WCHAR PathBuffer[MAX_PATH];
|
||||||
WCHAR InstallDir[51];
|
WCHAR InstallDir[51];
|
||||||
|
PWCHAR DefaultPath;
|
||||||
ULONG Length;
|
ULONG Length;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
/* Open 'SetupData' section */
|
||||||
|
Section = IniCacheGetSection(IniCache,
|
||||||
|
L"SetupData");
|
||||||
|
if (Section == NULL)
|
||||||
|
{
|
||||||
|
PopupError("Setup failed to find the 'SetupData' section\n"
|
||||||
|
"in TXTSETUP.SIF.\n",
|
||||||
|
"ENTER = Reboot computer");
|
||||||
|
|
||||||
|
while(TRUE)
|
||||||
|
{
|
||||||
|
ConInKey(Ir);
|
||||||
|
|
||||||
|
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
|
||||||
|
{
|
||||||
|
return(QUIT_PAGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Read the 'DefaultPath' key */
|
||||||
|
Status = IniCacheGetKey(Section,
|
||||||
|
L"DefaultPath",
|
||||||
|
&DefaultPath);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
wcscpy(InstallDir, L"\\reactos");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wcscpy(InstallDir, DefaultPath);
|
||||||
|
}
|
||||||
|
Length = wcslen(InstallDir);
|
||||||
|
|
||||||
SetTextXY(6, 8, "Setup installs ReactOS files onto the selected partition. Choose a");
|
SetTextXY(6, 8, "Setup installs ReactOS files onto the selected partition. Choose a");
|
||||||
SetTextXY(6, 9, "directory where you want ReactOS to be installed:");
|
SetTextXY(6, 9, "directory where you want ReactOS to be installed:");
|
||||||
|
|
||||||
wcscpy(InstallDir, L"\\reactos");
|
|
||||||
Length = wcslen(InstallDir);
|
|
||||||
|
|
||||||
SetInputTextXY(8, 11, 51, InstallDir);
|
SetInputTextXY(8, 11, 51, InstallDir);
|
||||||
|
|
||||||
SetTextXY(6, 14, "To change the suggested directory, press BACKSPACE to delete");
|
SetTextXY(6, 14, "To change the suggested directory, press BACKSPACE to delete");
|
||||||
SetTextXY(6, 15, "characters and then type the directory where you want ReactOS to");
|
SetTextXY(6, 15, "characters and then type the directory where you want ReactOS to");
|
||||||
SetTextXY(6, 16, "be installed.");
|
SetTextXY(6, 16, "be installed.");
|
||||||
|
|
||||||
|
|
||||||
SetStatusText(" ENTER = Continue F3 = Quit");
|
SetStatusText(" ENTER = Continue F3 = Quit");
|
||||||
|
|
||||||
while(TRUE)
|
while(TRUE)
|
||||||
|
@ -893,7 +926,7 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
|
||||||
}
|
}
|
||||||
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
|
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
|
||||||
{
|
{
|
||||||
/* Create 'DestinationPath' string */
|
/* Create 'InstallPath' string */
|
||||||
RtlFreeUnicodeString(&InstallPath);
|
RtlFreeUnicodeString(&InstallPath);
|
||||||
RtlCreateUnicodeString(&InstallPath,
|
RtlCreateUnicodeString(&InstallPath,
|
||||||
InstallDir);
|
InstallDir);
|
||||||
|
|
Loading…
Reference in a new issue