- Convert almost all swprintf() into StringCchPrintfW() and wcscpy() into StringCchCopyW();
- Explicitly add a trailing path separator to the "\Device\HarddiskX\PartitionY(\)" paths
when they refer to FS directories (and not to partition objects);
- Remove useless (and half-buggy) "Remove trailing backslash" code.
With that, it is possible to install ReactOS in e.g. C:\ReactOS (as usual), C:\ReactOS\dir1\dir2 (as many dirs as you wish), and also in C:\ (yes yes!).
But in that latter case, a strange bug related to the registry arises...
Additionally:
- Adjust some comments;
- Add some debugging DPRINTs;
- The SetInstallPathValue() is part of the big hack I've mentioned in f51faa4a (r74709).
svn path=/branches/setup_improvements/; revision=74717
Also, trim any potential trailing path separator from the NT disk partition path before opening the partition object itself for read/write access.
svn path=/branches/setup_improvements/; revision=74715
- Add the MUI ID resource.
- Implement the shutdown timeout progress bar function and the TimeOut string handler.
- Add the resource string to other resource languages.
- Simplify the usage of the PUPDATE_PROGRESS callback.
- Add the possibility of specifying an initial non-zero StepCount when
creating the progress-bar (using the -Ex version), so that it can be
initially drawn with the expected initial count.
Of course ProgressSetStepCount() can continue to be used.
Updated the font substitutions to use the new Hebrew glyphs in the updated Tahoma font.
Also added substitution for the Ubuntu font to make the Lautus and Modern themes legible with Hebrew UI elements.
Follow up to PR #789 and #790 ; CORE-14880, CORE-14943
Improve the progress bar functions:
- Add a member in the struct, which will be used as a bar colour parameter for the new CreateProgressBarEx().
- CreateProgressBar() which will now invoke the Ex variant without the additional parameter.
- Improved Italian translation for USETUP, WELCOME, REACTOS, EXPLORER.
- Completed translation in SYSSETUP.
- Correct some characters encoding and text alignment in USETUP.
DIRECTORY_ALL_ACCESS is not the correct flag, because it is used with the NtCreateDirectoryObject API
that creates virtual "directories" in the NT object namespace; that's not our purpose here.
svn path=/branches/setup_improvements/; revision=74716
- Use NT string safe functions.
- Add support for other bootloaders;
- Update a couple of comments;
- Remove deprecated __REACTOS__ #ifdefs.
svn path=/branches/setup_improvements/; revision=74713
- Remove a redundant NtClose() call;
- Return failure if NtQuerySymbolicLinkObject() fails;
- Use RTL_CONSTANT_STRING and RtlInitEmptyUnicodeString() where needed;
- Reduce code indent level;
- Add old-style function annotations;
- Remove the deprecated code copyright notice, since the copyright in usage is already reported in the COPYING file in the top level ReactOS source code directory.
svn path=/branches/setup_improvements/; revision=74698
- Adjust also its callers, adjust OpenAndMapFile() parameters.
- Related to that, simplify IsValidNTOSInstallation() parameters & introduce a IsValidNTOSInstallation_UStr()
that does the same, but takes a UNICODE_STRING instead.
- Simplify CheckForValidPEAndVendor().
Now only exactly 5 calls use the "old" 'DoesFileExist' syntax, using a temporarily auxiliary function "DoesFileExist_2"...
svn path=/branches/setup_improvements/; revision=74641
This allows building concatenated paths with an arbitrary number of separated components.
- Use the newly-introduced CombinePaths() and ConcatPaths() functions.
- Fix also few comments, and place some UNICODE_NULLs here & there.
svn path=/branches/setup_improvements/; revision=74637
svn path=/branches/setup_improvements/; revision=74640
- filesup.c's functions ConcatPaths(), Does[Path|File]Exist(), NtPathToDiskPartComponents(), OpenAndMapFile(), UnMapFile();
- Move the inicache library to setuplib as it'll be used for the 1st stage GUI setup too (indeed, there is no good INI file API
under Win32; the Win32 profile "API" is just good enough to manipulate the win16 ini files, and are here anyways for backward
compatibility purposes only);
- Move the OS detector too.
- Remove the duplicated ConcatPaths() code in arcname.c.
svn path=/branches/setup_improvements/; revision=74634
svn path=/branches/setup_improvements/; revision=74638
- In the partlist.c disk getters: Remove useless "IsListEmpty(&List->DiskListHead)" checks, because this is actually the kind of check the while() loop does just after...
- Fix few DPRINTs.
svn path=/branches/setup_improvements/; revision=74629
- Improve FindExistingNTOSInstall() so that we can find an existing installation either by system root
ARC path or NT path. This is used during the enumeration of available installations from the boot.ini/freeldr.ini
and during other existence & validity checks of NTOS installations.
- Improve AddNTOSInstallation() so that we can save the system root ARC path and NT path of the installation,
as well as its partition entry structure pointer, for caching & later retrieval purposes.
- Remove some deprecated comments & todos, and implement other todos.
- Improve the output of some DPRINTs.
- Fix the return value of FindSubStrI.
svn path=/branches/setup_improvements/; revision=74632
In all the disks/partitions available, it searches for the presence of freeldr.ini / boot.ini, open & parse them,
and enumerates the available boot entries (as candidates for installations). For each of them, it maps their ARC paths
into the NT namespace (hence the ARC 2 NT path resolver committed in r74621), then attempts to detect in these paths
the existence of NTOS installations.
svn path=/branches/setup_improvements/; revision=74622
The aim is to use this detector to be able to detect and select an existing installation of ReactOS for upgrading.
The user then could either select one, or skip this step and perform a regular ReactOS installation.
What remains to be done, is to parse the NTOS loader configuration files (freeldr.ini in ReactOS' case, or boot.ini in Win2k3's case, etc...)
to retrieve the actual installation paths. So far these are currently hardcoded for testing purposes only.
The detector attempts to distinguish between ReactOS and Windows installations by checking at the company name vendor of the ntoskrnl.exe & ntdll.dll files,
so that only ReactOS installations are allowed to be upgraded.
svn path=/branches/setup_improvements/; revision=74527
svn path=/branches/setup_improvements/; revision=74550
From the existing IniCacheLoad() function, introduce a IniCacheLoadFromMemory() function that just does the same (initialize an INI file cache and parse the INI file), but takes the input from a memory buffer. Then, rewrite the IniCacheLoad() function to just open the file given in input, and then fall back to calling IniCacheLoadFromMemory.
The IniCacheLoadFromMemory() function will be used later.
svn path=/branches/setup_improvements/; revision=74620
- Add a NtPathToDiskPartComponents() helper, that takes in input a fully qualified NT path to a file on hard disk,
e.g.: \Device\Harddisk1\Partition2\foo\bar, and returns in output the disk number ('1'), the partition number ('2'),
and the the path component "\foo\bar" that is after the device-harddisk-partition identifier.
- Make the OpenAndMapFile() return the file size of the opened file.
Both of these additions will be used soon.
- Turn a isspace() call into a iswspace() one.
svn path=/branches/setup_improvements/; revision=74619
- Use the previously-introduced 'PreparePartitionForFormatting()' function; set the FormatState of the newly-formatted partition to Formatted.
- Remove the hackish call to CreateFileSystemList() in SelectFileSystemPage().
- Move 'TempPartition' and 'FormatState' back to USETUP.
- Put large "case"-blocks into brackets.
svn path=/branches/setup_improvements/; revision=74575
svn path=/branches/setup_improvements/; revision=74576
- Add a PreparePartitionForFormatting routine that sets the partition ID depending on the chosen filesystem.
- The 'FORMATMACHINESTATE FormatState' machine-state and the 'TempPartition' members of the partition list structure is purely a USETUP convenience, so remove them from the PARTLIST structure and move them back into USETUP.
- Attempt to recognize the filesystem (set the 'FileSystem' member of PARTENTRY) of partitions we are adding into the PARTLIST list.
- Fix the return value of the SelectPartition function, which is by the way completely broken (it doesn't do what it is supposed to do; alternatively its naming is completely wrong...).
svn path=/branches/setup_improvements/; revision=74572
svn path=/branches/setup_improvements/; revision=74573
- 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
This will allow to reuse it for the 1st-stage GUI setup too, while using another UI representation.
Add also two partition iterator functions: GetNextPartition and GetPrevPartition.
svn path=/branches/setup_improvements/; revision=74554
The aim here is to decouple the UI-specific code from code that can be used by both the text-mode USETUP and a future 1st-stage GUI setup.
Indeed, the GenLists can actually be used in the 1st-stage GUI; and their contents be displayed inside ListBoxes/ListViews... (this is just one example amongst others).
Additionally (in usetup.c):
- Make both FormatPartitionPage and CheckFileSystemPage return PAGE_NUMBERs.
- Improve a couple of comments.
svn path=/branches/setup_improvements/; revision=74553
- Allow retrieving the number of items existing in the list;
- Fix the name of some function parameters.
svn path=/branches/setup_improvements/; revision=74547
- Document more some of the fields in the PARTENTRY, DISKETNRY and PARTLIST structures;
- Remove the redundant members "SystemDisk", "OriginalSystemDisk" and "TempDisk" in PARTLIST as these can be consistently deduced from the corresponding (Original)(System)(Temp)Partition members
(note that we however keep "CurrentDisk" alongside "CurrentPartition", see the comment in the code why we do it so).
- Adjust the rest of the code to take the removal of the redundant members into account. The 2nd parameter of GetNextUnformattedPartition() and GetNextUncheckedPartition() is now really optional.
- Introduce a SetPartitionType() helper to simplify the code that sets the partition type, which also automatically adjusts other internal variables of said partition in accordance.
- "Mounted" logical drives can have assigned letters too, registered in \DosDevices\.
svn path=/branches/setup_improvements/; revision=74532