Author: hpoussin
Date: Wed Jul 12 19:30:09 2006
New Revision: 23027
URL:
http://svn.reactos.org/svn/reactos?rev=23027&view=rev
Log:
Implement the 'You need to reboot' wizard page, and use it instead of the network
message box.
Main advantage is that the message box doesn't appear anymore during second stage
setup.
Modified:
trunk/reactos/dll/win32/netcfgx/netcfgx.c
trunk/reactos/dll/win32/newdev/De.rc
trunk/reactos/dll/win32/newdev/En.rc
trunk/reactos/dll/win32/newdev/Es.rc
trunk/reactos/dll/win32/newdev/Fr.rc
trunk/reactos/dll/win32/newdev/Hu.rc
trunk/reactos/dll/win32/newdev/Ru.rc
trunk/reactos/dll/win32/newdev/newdev.c
trunk/reactos/dll/win32/newdev/resource.h
trunk/reactos/dll/win32/newdev/wizard.c
Modified: trunk/reactos/dll/win32/netcfgx/netcfgx.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netcfgx/netcfgx.…
==============================================================================
--- trunk/reactos/dll/win32/netcfgx/netcfgx.c (original)
+++ trunk/reactos/dll/win32/netcfgx/netcfgx.c Wed Jul 12 19:30:09 2006
@@ -188,6 +188,7 @@
HKEY hLinkageKey = NULL;
HKEY hNetworkKey = NULL;
HKEY hConnectionKey = NULL;
+ SP_DEVINSTALL_PARAMS_W installParams;
if (InstallFunction != DIF_INSTALLDEVICE)
return ERROR_DI_DO_DEFAULT;
@@ -437,7 +438,27 @@
* which are installed after its startup. So, we have to reboot to take
* this new netcard into account.
*/
- MessageBox(NULL, TEXT("You need to reboot to finish the installation of your
network card."), TEXT("Reboot required"), MB_OK | MB_ICONWARNING);
+ /* Should we reboot? */
+ installParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS_W);
+ if (!SetupDiGetDeviceInstallParamsW(
+ DeviceInfoSet,
+ DeviceInfoData,
+ &installParams))
+ {
+ rc = GetLastError();
+ DPRINT("SetupDiGetDeviceInstallParams() failed with error 0x%lx\n", rc);
+ goto cleanup;
+ }
+ installParams.Flags |= DI_NEEDRESTART;
+ if (!SetupDiSetDeviceInstallParamsW(
+ DeviceInfoSet,
+ DeviceInfoData,
+ &installParams))
+ {
+ rc = GetLastError();
+ DPRINT("SetupDiSetDeviceInstallParams() failed with error 0x%lx\n", rc);
+ goto cleanup;
+ }
rc = ERROR_SUCCESS;
cleanup:
Modified: trunk/reactos/dll/win32/newdev/De.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/De.rc?rev…
==============================================================================
--- trunk/reactos/dll/win32/newdev/De.rc (original)
+++ trunk/reactos/dll/win32/newdev/De.rc Wed Jul 12 19:30:09 2006
@@ -79,6 +79,20 @@
LTEXT "UNKNOWN DEVICE",IDC_DEVICE,51,20,169,16
END
+IDD_NEEDREBOOT DIALOG DISCARDABLE 0, 0, 317, 193
+STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION |
+ WS_SYSMENU
+CAPTION "Device installation"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Installation complete",IDC_FINISHTITLE,120,8,195,11
+ LTEXT "You need to reboot to finish the install of:",
+ IDC_STATIC,120,32,195,19
+ LTEXT "Click Finish to close the wizard.",IDC_STATIC,120,174,
+ 179,11
+ LTEXT "UNKNOWN DEVICE",IDC_DEVICE,148,53,147,12
+END
+
IDD_FINISHPAGE DIALOG DISCARDABLE 0, 0, 317, 193
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
Modified: trunk/reactos/dll/win32/newdev/En.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/En.rc?rev…
==============================================================================
--- trunk/reactos/dll/win32/newdev/En.rc (original)
+++ trunk/reactos/dll/win32/newdev/En.rc Wed Jul 12 19:30:09 2006
@@ -79,6 +79,20 @@
LTEXT "UNKNOWN DEVICE",IDC_DEVICE,51,20,169,16
END
+IDD_NEEDREBOOT DIALOG DISCARDABLE 0, 0, 317, 193
+STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION |
+ WS_SYSMENU
+CAPTION "Device installation"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Installation complete",IDC_FINISHTITLE,120,8,195,11
+ LTEXT "You need to reboot to finish the install of:",
+ IDC_STATIC,120,32,195,19
+ LTEXT "Click Finish to close the wizard.",IDC_STATIC,120,174,
+ 179,11
+ LTEXT "UNKNOWN DEVICE",IDC_DEVICE,148,53,147,12
+END
+
IDD_FINISHPAGE DIALOG DISCARDABLE 0, 0, 317, 193
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
Modified: trunk/reactos/dll/win32/newdev/Es.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/Es.rc?rev…
==============================================================================
--- trunk/reactos/dll/win32/newdev/Es.rc (original)
+++ trunk/reactos/dll/win32/newdev/Es.rc Wed Jul 12 19:30:09 2006
@@ -79,6 +79,20 @@
LTEXT "DISPOSITIVO DESCONOCIDO",IDC_DEVICE,51,20,169,16
END
+IDD_NEEDREBOOT DIALOG DISCARDABLE 0, 0, 317, 193
+STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION |
+ WS_SYSMENU
+CAPTION "Device installation"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Installation complete",IDC_FINISHTITLE,120,8,195,11
+ LTEXT "You need to reboot to finish the install of:",
+ IDC_STATIC,120,32,195,19
+ LTEXT "Click Finish to close the wizard.",IDC_STATIC,120,174,
+ 179,11
+ LTEXT "UNKNOWN DEVICE",IDC_DEVICE,148,53,147,12
+END
+
IDD_FINISHPAGE DIALOG DISCARDABLE 0, 0, 317, 193
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
Modified: trunk/reactos/dll/win32/newdev/Fr.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/Fr.rc?rev…
==============================================================================
--- trunk/reactos/dll/win32/newdev/Fr.rc (original)
+++ trunk/reactos/dll/win32/newdev/Fr.rc Wed Jul 12 19:30:09 2006
@@ -7,7 +7,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Bienvenue",IDC_WELCOMETITLE,115,8,195,24
- LTEXT "Cet assistant installe un nouveau pilote pour:",
+ LTEXT "Cet assistant installe un nouveau pilote pour :",
IDC_STATIC,115,21,195,16
LTEXT "Cliquer sur Suivant pour
continuer.",IDC_STATIC,115,169,195,17
LTEXT "MATERIEL INCONNU",IDC_DEVICE,129,36,164,11
@@ -79,6 +79,20 @@
LTEXT "MATERIEL INCONNU",IDC_DEVICE,51,20,169,16
END
+IDD_NEEDREBOOT DIALOG DISCARDABLE 0, 0, 317, 193
+STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION |
+ WS_SYSMENU
+CAPTION "Device installation"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Installation terminée",IDC_FINISHTITLE,120,8,195,11
+ LTEXT "Vous devez redémarrer l'ordinateur avant d'utiliser
:",
+ IDC_STATIC,120,32,195,19
+ LTEXT "Cliquer sur Terminer pour fermer
l'assistant.",IDC_STATIC,120,174,
+ 179,11
+ LTEXT "UNKNOWN DEVICE",IDC_DEVICE,148,53,147,12
+END
+
IDD_FINISHPAGE DIALOG DISCARDABLE 0, 0, 317, 193
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
@@ -86,7 +100,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Installation terminée",IDC_FINISHTITLE,115,8,195,11
- LTEXT "L'assistant a fini d'installer le pilote pour:",
+ LTEXT "L'assistant a fini d'installer le pilote pour :",
IDC_STATIC,115,32,195,19
LTEXT "Cliquer sur Terminer pour fermer
l'assistant.",IDC_STATIC,115,174,
179,11
Modified: trunk/reactos/dll/win32/newdev/Hu.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/Hu.rc?rev…
==============================================================================
--- trunk/reactos/dll/win32/newdev/Hu.rc (original)
+++ trunk/reactos/dll/win32/newdev/Hu.rc Wed Jul 12 19:30:09 2006
@@ -80,6 +80,20 @@
LTEXT "Ismeretlen eszköz!",IDC_DEVICE,51,20,169,16
END
+IDD_NEEDREBOOT DIALOG DISCARDABLE 0, 0, 317, 193
+STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION |
+ WS_SYSMENU
+CAPTION "Device installation"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Installation complete",IDC_FINISHTITLE,120,8,195,11
+ LTEXT "You need to reboot to finish the install of:",
+ IDC_STATIC,120,32,195,19
+ LTEXT "Click Finish to close the wizard.",IDC_STATIC,120,174,
+ 179,11
+ LTEXT "UNKNOWN DEVICE",IDC_DEVICE,148,53,147,12
+END
+
IDD_FINISHPAGE DIALOG DISCARDABLE 0, 0, 317, 193
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
Modified: trunk/reactos/dll/win32/newdev/Ru.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/Ru.rc?rev…
==============================================================================
--- trunk/reactos/dll/win32/newdev/Ru.rc (original)
+++ trunk/reactos/dll/win32/newdev/Ru.rc Wed Jul 12 19:30:09 2006
@@ -79,6 +79,20 @@
LTEXT "Íåèçâåñòíîå óñòðîéñòâî",IDC_DEVICE,51,20,169,16
END
+IDD_NEEDREBOOT DIALOG DISCARDABLE 0, 0, 317, 193
+STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION |
+ WS_SYSMENU
+CAPTION "Device installation"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Installation complete",IDC_FINISHTITLE,120,8,195,11
+ LTEXT "You need to reboot to finish the install of:",
+ IDC_STATIC,120,32,195,19
+ LTEXT "Click Finish to close the wizard.",IDC_STATIC,120,174,
+ 179,11
+ LTEXT "UNKNOWN DEVICE",IDC_DEVICE,148,53,147,12
+END
+
IDD_FINISHPAGE DIALOG DISCARDABLE 0, 0, 317, 193
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
Modified: trunk/reactos/dll/win32/newdev/newdev.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/newdev.c?…
==============================================================================
--- trunk/reactos/dll/win32/newdev/newdev.c (original)
+++ trunk/reactos/dll/win32/newdev/newdev.c Wed Jul 12 19:30:09 2006
@@ -457,9 +457,6 @@
DWORD LengthNeeded = 0;
LPTSTR Buffer;
- TRACE("Include removable devices: %s\n", IncludeRemovableDevices ?
"yes" : "no");
- TRACE("Include custom path : %s\n", IncludeCustomPath ? "yes" :
"no");
-
/* Calculate length needed to store the search paths */
if (IncludeRemovableDevices)
{
@@ -748,6 +745,20 @@
{
/* Driver found ; install it */
retval = InstallCurrentDriver(DevInstData);
+ if (retval && Show != SW_HIDE)
+ {
+ /* Should we display the 'Need to reboot' page? */
+ SP_DEVINSTALL_PARAMS installParams;
+ installParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
+ if (SetupDiGetDeviceInstallParams(
+ DevInstData->hDevInfo,
+ &DevInstData->devInfoData,
+ &installParams))
+ {
+ if (installParams.Flags & (DI_NEEDRESTART | DI_NEEDREBOOT))
+ retval = DisplayWizard(DevInstData, hWndParent, IDD_NEEDREBOOT);
+ }
+ }
goto cleanup;
}
else if (Show == SW_HIDE)
Modified: trunk/reactos/dll/win32/newdev/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/resource.…
==============================================================================
--- trunk/reactos/dll/win32/newdev/resource.h (original)
+++ trunk/reactos/dll/win32/newdev/resource.h Wed Jul 12 19:30:09 2006
@@ -25,6 +25,8 @@
#define IDD_INSTALLDRV 3
#define IDD_NODRIVER 4
#define IDD_INSTALLFAILED 5
-#define IDD_FINISHPAGE 6
+#define IDD_NEEDREBOOT 6
+#define IDD_FINISHPAGE 7
+#define IDD_MAXIMUMPAGE IDD_FINISHPAGE
#endif /* RESOURCE_H */
Modified: trunk/reactos/dll/win32/newdev/wizard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/wizard.c?…
==============================================================================
--- trunk/reactos/dll/win32/newdev/wizard.c (original)
+++ trunk/reactos/dll/win32/newdev/wizard.c Wed Jul 12 19:30:09 2006
@@ -502,7 +502,7 @@
break;
}
- return FALSE;
+ return DefWindowProc(hwndDlg, uMsg, wParam, lParam);
}
static void
@@ -664,7 +664,7 @@
break;
}
- return FALSE;
+ return DefWindowProc(hwndDlg, uMsg, wParam, lParam);
}
static INT_PTR CALLBACK
@@ -759,7 +759,7 @@
break;
}
- return FALSE;
+ return DefWindowProc(hwndDlg, uMsg, wParam, lParam);
}
static INT_PTR CALLBACK
@@ -810,9 +810,25 @@
CloseHandle(hThread);
hThread = 0;
if (wParam == 0)
- PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_FINISHPAGE);
- else
- PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_INSTALLFAILED);
+ {
+ /* Should we reboot? */
+ SP_DEVINSTALL_PARAMS installParams;
+ installParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
+ if (SetupDiGetDeviceInstallParams(
+ DevInstData->hDevInfo,
+ &DevInstData->devInfoData,
+ &installParams))
+ {
+ if (installParams.Flags & (DI_NEEDRESTART | DI_NEEDREBOOT))
+ {
+ PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_NEEDREBOOT);
+ }
+ else
+ PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_FINISHPAGE);
+ break;
+ }
+ }
+ PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_INSTALLFAILED);
break;
}
@@ -849,7 +865,7 @@
break;
}
- return FALSE;
+ return DefWindowProc(hwndDlg, uMsg, wParam, lParam);
}
static INT_PTR CALLBACK
@@ -873,8 +889,12 @@
{
BOOL DisableableDevice = FALSE;
+ /* Get pointer to the global setup data */
DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData);
+
+ /* Center the wizard window */
+ CenterWindow(GetParent(hwndDlg));
hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
ShowWindow(hwndControl, SW_HIDE);
@@ -960,7 +980,7 @@
break;
}
- return FALSE;
+ return DefWindowProc(hwndDlg, uMsg, wParam, lParam);
}
static INT_PTR CALLBACK
@@ -985,6 +1005,9 @@
/* Get pointer to the global setup data */
DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData);
+
+ /* Center the wizard window */
+ CenterWindow(GetParent(hwndDlg));
hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
ShowWindow(hwndControl, SW_HIDE);
@@ -1036,11 +1059,11 @@
break;
}
- return FALSE;
+ return DefWindowProc(hwndDlg, uMsg, wParam, lParam);
}
static INT_PTR CALLBACK
-FinishDlgProc(
+NeedRebootDlgProc(
IN HWND hwndDlg,
IN UINT uMsg,
IN WPARAM wParam,
@@ -1061,6 +1084,9 @@
/* Get pointer to the global setup data */
DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData);
+
+ /* Center the wizard window */
+ CenterWindow(GetParent(hwndDlg));
hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
ShowWindow(hwndControl, SW_HIDE);
@@ -1112,7 +1138,86 @@
break;
}
- return FALSE;
+ return DefWindowProc(hwndDlg, uMsg, wParam, lParam);
+}
+
+static INT_PTR CALLBACK
+FinishDlgProc(
+ IN HWND hwndDlg,
+ IN UINT uMsg,
+ IN WPARAM wParam,
+ IN LPARAM lParam)
+{
+ PDEVINSTDATA DevInstData;
+ UNREFERENCED_PARAMETER(wParam);
+
+ /* Retrieve pointer to the global setup data */
+ DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
+
+ switch (uMsg)
+ {
+ case WM_INITDIALOG:
+ {
+ HWND hwndControl;
+
+ /* Get pointer to the global setup data */
+ DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
+ SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData);
+
+ /* Center the wizard window */
+ CenterWindow(GetParent(hwndDlg));
+
+ hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
+ ShowWindow(hwndControl, SW_HIDE);
+ EnableWindow(hwndControl, FALSE);
+
+ SendDlgItemMessage(
+ hwndDlg,
+ IDC_DEVICE,
+ WM_SETTEXT,
+ 0,
+ (LPARAM)DevInstData->drvInfoData.Description);
+
+ /* Set title font */
+ SendDlgItemMessage(
+ hwndDlg,
+ IDC_FINISHTITLE,
+ WM_SETFONT,
+ (WPARAM)DevInstData->hTitleFont,
+ (LPARAM)TRUE);
+ break;
+ }
+
+ case WM_NOTIFY:
+ {
+ LPNMHDR lpnm = (LPNMHDR)lParam;
+
+ switch (lpnm->code)
+ {
+ case PSN_SETACTIVE:
+ /* Enable the correct buttons on for the active page */
+ PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_FINISH);
+ break;
+
+ case PSN_WIZBACK:
+ /* Handle a Back button click, if necessary */
+ break;
+
+ case PSN_WIZFINISH:
+ /* Handle a Finish button click, if necessary */
+ break;
+
+ default:
+ break;
+ }
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ return DefWindowProc(hwndDlg, uMsg, wParam, lParam);
}
static HFONT
@@ -1147,7 +1252,7 @@
IN UINT startPage)
{
PROPSHEETHEADER psh;
- HPROPSHEETPAGE ahpsp[IDD_FINISHPAGE + 1];
+ HPROPSHEETPAGE ahpsp[IDD_MAXIMUMPAGE + 1];
PROPSHEETPAGE psp;
/* Create the Welcome page */
@@ -1190,6 +1295,12 @@
psp.pszTemplate = MAKEINTRESOURCE(IDD_INSTALLFAILED);
ahpsp[IDD_INSTALLFAILED] = CreatePropertySheetPage(&psp);
+ /* Create the Need reboot page */
+ psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
+ psp.pfnDlgProc = (DLGPROC) NeedRebootDlgProc;
+ psp.pszTemplate = MAKEINTRESOURCE(IDD_NEEDREBOOT);
+ ahpsp[IDD_NEEDREBOOT] = CreatePropertySheetPage(&psp);
+
/* Create the Finish page */
psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
psp.pfnDlgProc = (DLGPROC) FinishDlgProc;
@@ -1201,7 +1312,7 @@
psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
psh.hInstance = hDllInstance;
psh.hwndParent = hwndParent;
- psh.nPages = IDD_FINISHPAGE + 1;
+ psh.nPages = IDD_MAXIMUMPAGE + 1;
psh.nStartPage = startPage;
psh.phpage = ahpsp;
psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);