From 2351d0ea8c0fe0140568e468ce111bc04b678ac0 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Mollazadeh Date: Fri, 19 Jun 2026 00:46:31 +0330 Subject: [PATCH] [SETUP:REACTOS] Fix page transition in setup wizard (#9172) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CORE-20661, CORE-13525 The GUI-mode setup was asking the user for device configuration and installation destination partition, even when upgrading or repairing an existing installation. It doesn't make sense to ask: e.g. you shouldn't be able to upgrade an installation in C: to D: partition; and the setup ignores what the user chooses: e.g. if your installation is using a 1024x768 resolution, choosing another resolution during the SETUP won't change the resolution. Thus, the setup should skip these pages without asking anything from user. This is also consistent with USETUP's behavior. - Set `InstallPartition` and `InstallationDirectory` to selected repair/upgrade target volume and directory. - Jump to the Summary page from the Install type/upgrade pages. - Return to the Install type/upgrade page when navigating backward from the Summary page. - Return to the Installation type page when navigating backward from the Device page. Co-authored-by: Hermès BÉLUSCA - MAÏTO --- base/setup/reactos/reactos.c | 41 +++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/base/setup/reactos/reactos.c b/base/setup/reactos/reactos.c index 4638273dea3..632c649e2d6 100644 --- a/base/setup/reactos/reactos.c +++ b/base/setup/reactos/reactos.c @@ -526,8 +526,13 @@ TypeDlgProc( /* Retrieve the current installation */ pSetupData->CurrentInstallation = (PNTOS_INSTALLATION)GetListEntryData(GetCurrentListEntry(pSetupData->NtOsInstallsList)); + InstallPartition = pSetupData->CurrentInstallation->Volume->PartEntry; + StringCchCopyW(pSetupData->USetupData.InstallationDirectory, + _countof(pSetupData->USetupData.InstallationDirectory), + pSetupData->CurrentInstallation->PathComponent); - SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, IDD_DEVICEPAGE); + /* Jump to the Summary page during repair/upgrade */ + SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, IDD_SUMMARYPAGE); } } else @@ -953,9 +958,15 @@ UpgradeRepairDlgProc( /* Retrieve the current installation */ pSetupData->CurrentInstallation = (PNTOS_INSTALLATION)GetListEntryData(GetCurrentListEntry(pSetupData->NtOsInstallsList)); + InstallPartition = pSetupData->CurrentInstallation->Volume->PartEntry; + StringCchCopyW(pSetupData->USetupData.InstallationDirectory, + _countof(pSetupData->USetupData.InstallationDirectory), + pSetupData->CurrentInstallation->PathComponent); /* We perform an upgrade */ pSetupData->RepairUpdateFlag = TRUE; + /* Jump to the Summary page during repair/upgrade */ + SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, IDD_SUMMARYPAGE); return TRUE; } @@ -1062,6 +1073,13 @@ DeviceDlgProc( return TRUE; } + case PSN_WIZBACK: + { + /* Return to the Install type selection page instead of the Repair/Upgrade page */ + SetWindowLongW(hwndDlg, DWLP_MSGRESULT, IDD_TYPEPAGE); + return TRUE; + } + default: break; } @@ -1241,6 +1259,27 @@ SummaryDlgProc( return TRUE; } + case PSN_WIZBACK: + { + /* When the user performs a regular installation, go back to the previous page */ + if (!pSetupData->RepairUpdateFlag) + break; + + if (GetNumberOfListEntries(pSetupData->NtOsInstallsList) > 1) + { + /* Return to the Upgrade/Repair selection page, when the user is + * upgrading and there are more than one installation available */ + SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, IDD_UPDATEREPAIRPAGE); + } + else + { + /* Return to the Install type selection page, when the user is + * upgrading and there is at most one installation available */ + SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, IDD_TYPEPAGE); + } + return TRUE; + } + default: break; }