[SETUP:REACTOS] Fix page transition in setup wizard (#9172)

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 <[email protected]>
This commit is contained in:
Mohammad Amin Mollazadeh
2026-06-18 23:16:31 +02:00
committed by GitHub
co-authored by Hermès BÉLUSCA - MAÏTO
parent c1670e1614
commit 2351d0ea8c
+40 -1
View File
@@ -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;
}