[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Setup Library
|
|
|
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
|
|
|
* PURPOSE: Public header
|
|
|
|
* COPYRIGHT: Copyright 2017-2018 Hermes Belusca-Maito
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2017-08-08 14:05:20 +00:00
|
|
|
/* INCLUDES *****************************************************************/
|
|
|
|
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
/* Needed PSDK headers when using this library */
|
|
|
|
#if 0
|
|
|
|
|
|
|
|
#define WIN32_NO_STATUS
|
|
|
|
#define _INC_WINDOWS
|
|
|
|
#define COM_NO_WINDOWS_H
|
|
|
|
|
2017-05-31 01:43:12 +00:00
|
|
|
#include <winxxx.h>
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* NOTE: Please keep the header inclusion order! */
|
|
|
|
|
|
|
|
extern HANDLE ProcessHeap;
|
|
|
|
|
|
|
|
#include "errorcode.h"
|
2018-01-06 15:47:37 +00:00
|
|
|
#include "spapisup/fileqsup.h"
|
|
|
|
#include "spapisup/infsupp.h"
|
2017-08-28 11:28:08 +00:00
|
|
|
#include "utils/linklist.h"
|
|
|
|
#include "utils/ntverrsrc.h"
|
|
|
|
// #include "utils/arcname.h"
|
|
|
|
#include "utils/bldrsup.h"
|
|
|
|
#include "utils/filesup.h"
|
2020-10-11 21:42:02 +00:00
|
|
|
#include "utils/fsrec.h"
|
2017-08-28 11:28:08 +00:00
|
|
|
#include "utils/genlist.h"
|
|
|
|
#include "utils/inicache.h"
|
2020-11-11 00:37:16 +00:00
|
|
|
#include "utils/partinfo.h"
|
2017-08-28 11:28:08 +00:00
|
|
|
#include "utils/partlist.h"
|
|
|
|
#include "utils/arcname.h"
|
|
|
|
#include "utils/osdetect.h"
|
|
|
|
#include "utils/regutil.h"
|
2020-10-17 18:29:47 +00:00
|
|
|
#include "bootcode.h"
|
|
|
|
#include "fsutil.h"
|
|
|
|
#include "bootsup.h"
|
2017-06-30 19:07:02 +00:00
|
|
|
#include "registry.h"
|
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib.
[SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build.
svn path=/branches/setup_improvements/; revision=75711
[SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources",
and what concerns general language parameters (in the setuplib).
It may be interesting to retrieve the language parameters
from INF file (e.g. intl.inf) (suggested by Giannis).
svn path=/branches/setup_improvements/; revision=75715
[SETUPLIB] Add the necessary headers to mui.c to be able to compile.
[USETUP] Comment out the languages that don't have any resources.
svn path=/branches/setup_improvements/; revision=75716
[SETUPLIB][USETUP] Adjust MUI and settings code.
- Re-enable settings code concerning language, keyboards & layout
in the setuplib, and remove the old code in usetup.
- Remove useless code in setuplib's mui.c.
- Rename usetup's MUI "LanguageList" into "ResourceList" so as to
avoid colliding with the "LanguageList" of setuplib.
- Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that
I forgot previously, that caused the "LanguageList" of setuplib to be empty!
The code compiles and works during my tests.
svn path=/branches/setup_improvements/; revision=75717
[SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific
"SelectedLanguageId" variable is not used in the library.
svn path=/branches/setup_improvements/; revision=75719
[SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library.
Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again.
svn path=/branches/setup_improvements/; revision=75720
svn path=/branches/setup_improvements/; revision=75724
[USETUP] Code adaptations.
- Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element.
- Modify MUIGetOEMCodePage() call after r75719.
- Use PCWSTR where needed.
svn path=/branches/setup_improvements/; revision=75722
[USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721.
svn path=/branches/setup_improvements/; revision=75723
[INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
|
|
|
#include "mui.h"
|
2017-08-28 14:46:49 +00:00
|
|
|
#include "settings.h"
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
|
2018-01-07 00:35:48 +00:00
|
|
|
// #include "install.h" // See at the end...
|
|
|
|
|
2017-08-08 14:05:20 +00:00
|
|
|
|
|
|
|
/* DEFINES ******************************************************************/
|
|
|
|
|
|
|
|
#define KB ((ULONGLONG)1024)
|
|
|
|
#define MB (KB*KB)
|
|
|
|
#define GB (KB*KB*KB)
|
|
|
|
// #define TB (KB*KB*KB*KB)
|
|
|
|
// #define PB (KB*KB*KB*KB*KB)
|
|
|
|
|
|
|
|
|
2017-08-09 20:39:45 +00:00
|
|
|
/* TYPEDEFS *****************************************************************/
|
|
|
|
|
2018-01-05 01:51:51 +00:00
|
|
|
struct _USETUP_DATA;
|
|
|
|
|
2018-10-28 21:51:33 +00:00
|
|
|
typedef VOID
|
|
|
|
(__cdecl *PSETUP_ERROR_ROUTINE)(IN struct _USETUP_DATA*, ...);
|
|
|
|
|
2017-08-09 20:39:45 +00:00
|
|
|
typedef struct _USETUP_DATA
|
|
|
|
{
|
2018-10-28 21:51:33 +00:00
|
|
|
/* Error handling *****/
|
|
|
|
ERROR_NUMBER LastErrorNumber;
|
|
|
|
PSETUP_ERROR_ROUTINE ErrorRoutine;
|
|
|
|
|
2018-01-05 01:51:51 +00:00
|
|
|
/* Setup INFs *****/
|
|
|
|
HINF SetupInf;
|
|
|
|
|
|
|
|
/* Installation *****/
|
|
|
|
PVOID SetupFileQueue; // HSPFILEQ
|
|
|
|
|
2017-08-09 20:39:45 +00:00
|
|
|
/* SOURCE Paths *****/
|
|
|
|
UNICODE_STRING SourceRootPath;
|
|
|
|
UNICODE_STRING SourceRootDir;
|
|
|
|
UNICODE_STRING SourcePath;
|
|
|
|
|
|
|
|
/* DESTINATION Paths *****/
|
|
|
|
/*
|
|
|
|
* Path to the system partition, where the boot manager resides.
|
|
|
|
* On x86 PCs, this is usually the active partition.
|
|
|
|
* On ARC, (u)EFI, ... platforms, this is a dedicated partition.
|
|
|
|
*
|
|
|
|
* For more information, see:
|
|
|
|
* https://en.wikipedia.org/wiki/System_partition_and_boot_partition
|
|
|
|
* http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/boot-and-system-volumes.html
|
|
|
|
* http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/arc-boot-process.html
|
|
|
|
* http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/efi-boot-process.html
|
|
|
|
* http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/determining-system-volume.html
|
|
|
|
* http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/determining-boot-volume.html
|
|
|
|
*/
|
|
|
|
UNICODE_STRING SystemRootPath;
|
|
|
|
|
|
|
|
/* Path to the installation directory inside the ReactOS boot partition */
|
|
|
|
UNICODE_STRING DestinationArcPath; /** Equivalent of 'NTOS_INSTALLATION::SystemArcPath' **/
|
2018-01-05 01:51:51 +00:00
|
|
|
UNICODE_STRING DestinationPath; /** Equivalent of 'NTOS_INSTALLATION::SystemNtPath' **/
|
2017-08-09 20:39:45 +00:00
|
|
|
UNICODE_STRING DestinationRootPath;
|
|
|
|
|
2018-01-05 01:51:51 +00:00
|
|
|
// FIXME: This is only temporary!! Must be removed later!
|
|
|
|
UNICODE_STRING InstallPath;
|
|
|
|
|
2017-08-09 20:39:45 +00:00
|
|
|
LONG DestinationDiskNumber;
|
|
|
|
LONG DestinationPartitionNumber;
|
|
|
|
|
2018-01-05 01:51:51 +00:00
|
|
|
LONG MBRInstallType;
|
2017-08-09 20:39:45 +00:00
|
|
|
LONG FormatPartition;
|
|
|
|
LONG AutoPartition;
|
2018-12-28 19:34:48 +00:00
|
|
|
LONG FsType;
|
2017-08-09 20:39:45 +00:00
|
|
|
|
2018-01-05 01:51:51 +00:00
|
|
|
/* Settings lists *****/
|
|
|
|
PGENERIC_LIST ComputerList;
|
|
|
|
PGENERIC_LIST DisplayList;
|
|
|
|
PGENERIC_LIST KeyboardList;
|
|
|
|
PGENERIC_LIST LayoutList;
|
|
|
|
PGENERIC_LIST LanguageList;
|
|
|
|
|
2024-02-15 22:10:55 +00:00
|
|
|
/* Settings *****/
|
|
|
|
PCWSTR ComputerType;
|
|
|
|
PCWSTR DisplayType;
|
|
|
|
// PCWSTR KeyboardDriver;
|
|
|
|
// PCWSTR MouseDriver;
|
|
|
|
PCWSTR LayoutId; // DefaultKBLayout
|
|
|
|
|
2018-01-05 01:51:51 +00:00
|
|
|
/* Other stuff *****/
|
2017-08-09 20:39:45 +00:00
|
|
|
WCHAR LocaleID[9];
|
|
|
|
LANGID LanguageId;
|
|
|
|
|
|
|
|
ULONG RequiredPartitionDiskSpace;
|
|
|
|
WCHAR InstallationDirectory[MAX_PATH];
|
|
|
|
} USETUP_DATA, *PUSETUP_DATA;
|
|
|
|
|
2018-01-07 00:35:48 +00:00
|
|
|
|
|
|
|
#include "install.h"
|
|
|
|
|
|
|
|
|
2017-08-09 20:39:45 +00:00
|
|
|
// HACK!!
|
|
|
|
extern BOOLEAN IsUnattendedSetup;
|
|
|
|
|
|
|
|
|
|
|
|
/* FUNCTIONS ****************************************************************/
|
|
|
|
|
2020-02-14 01:47:20 +00:00
|
|
|
#include "substset.h"
|
|
|
|
|
2017-08-09 20:39:45 +00:00
|
|
|
VOID
|
|
|
|
CheckUnattendedSetup(
|
|
|
|
IN OUT PUSETUP_DATA pSetupData);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
InstallSetupInfFile(
|
|
|
|
IN OUT PUSETUP_DATA pSetupData);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
GetSourcePaths(
|
|
|
|
OUT PUNICODE_STRING SourcePath,
|
|
|
|
OUT PUNICODE_STRING SourceRootPath,
|
|
|
|
OUT PUNICODE_STRING SourceRootDir);
|
|
|
|
|
|
|
|
ERROR_NUMBER
|
|
|
|
LoadSetupInf(
|
2018-01-05 01:51:51 +00:00
|
|
|
IN OUT PUSETUP_DATA pSetupData);
|
|
|
|
|
2020-11-23 03:38:51 +00:00
|
|
|
#define ERROR_SYSTEM_PARTITION_NOT_FOUND (ERROR_LAST_ERROR_CODE + 1)
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
InitSystemPartition(
|
|
|
|
/**/_In_ PPARTLIST PartitionList, /* HACK HACK! */
|
|
|
|
/**/_In_ PPARTENTRY InstallPartition, /* HACK HACK! */
|
|
|
|
/**/_Out_ PPARTENTRY* pSystemPartition, /* HACK HACK! */
|
|
|
|
_In_opt_ PFSVOL_CALLBACK FsVolCallback,
|
|
|
|
_In_opt_ PVOID Context);
|
|
|
|
|
2024-08-11 19:04:18 +00:00
|
|
|
/**
|
|
|
|
* @brief
|
|
|
|
* Defines the class of characters valid for the installation directory.
|
|
|
|
*
|
|
|
|
* The valid characters are: ASCII alphanumericals (a-z, A-Z, 0-9),
|
|
|
|
* and: '.', '\\', '-', '_' . Spaces are not allowed.
|
|
|
|
**/
|
2024-07-25 16:57:23 +00:00
|
|
|
#define IS_VALID_INSTALL_PATH_CHAR(c) \
|
2024-08-11 19:04:18 +00:00
|
|
|
(isalnum(c) || (c) == L'.' || (c) == L'\\' || (c) == L'-' || (c) == L'_')
|
2024-07-25 16:57:23 +00:00
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
IsValidInstallDirectory(
|
|
|
|
_In_ PCWSTR InstallDir);
|
|
|
|
|
2018-01-05 01:51:51 +00:00
|
|
|
NTSTATUS
|
|
|
|
InitDestinationPaths(
|
|
|
|
IN OUT PUSETUP_DATA pSetupData,
|
|
|
|
IN PCWSTR InstallationDir,
|
|
|
|
IN PPARTENTRY PartEntry); // FIXME: HACK!
|
|
|
|
|
|
|
|
// NTSTATUS
|
|
|
|
ERROR_NUMBER
|
|
|
|
InitializeSetup(
|
|
|
|
IN OUT PUSETUP_DATA pSetupData,
|
|
|
|
IN ULONG InitPhase);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
FinishSetup(
|
2017-08-09 20:39:45 +00:00
|
|
|
IN OUT PUSETUP_DATA pSetupData);
|
|
|
|
|
|
|
|
|
2017-09-03 16:17:27 +00:00
|
|
|
typedef enum _REGISTRY_STATUS
|
|
|
|
{
|
|
|
|
Success = 0,
|
|
|
|
RegHiveUpdate,
|
|
|
|
ImportRegHive,
|
|
|
|
DisplaySettingsUpdate,
|
|
|
|
LocaleSettingsUpdate,
|
|
|
|
KeybLayouts,
|
|
|
|
KeybSettingsUpdate,
|
|
|
|
CodePageInfoUpdate,
|
|
|
|
} REGISTRY_STATUS;
|
|
|
|
|
|
|
|
typedef VOID
|
|
|
|
(__cdecl *PREGISTRY_STATUS_ROUTINE)(IN REGISTRY_STATUS, ...);
|
|
|
|
|
|
|
|
ERROR_NUMBER
|
|
|
|
UpdateRegistry(
|
|
|
|
IN OUT PUSETUP_DATA pSetupData,
|
|
|
|
/**/IN BOOLEAN RepairUpdateFlag, /* HACK HACK! */
|
|
|
|
/**/IN PPARTLIST PartitionList, /* HACK HACK! */
|
|
|
|
/**/IN WCHAR DestinationDriveLetter, /* HACK HACK! */
|
|
|
|
/**/IN PCWSTR SelectedLanguageId, /* HACK HACK! */
|
2020-02-14 01:47:20 +00:00
|
|
|
IN PREGISTRY_STATUS_ROUTINE StatusRoutine OPTIONAL,
|
|
|
|
IN PFONTSUBSTSETTINGS SubstSettings OPTIONAL);
|
2017-09-03 16:17:27 +00:00
|
|
|
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
/* EOF */
|