- Display install page when installing the device, instead of search page
authorHervé Poussineau <hpoussin@reactos.org>
Sun, 28 May 2006 20:21:43 +0000 (20:21 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Sun, 28 May 2006 20:21:43 +0000 (20:21 +0000)
- Add "install failed" page

svn path=/trunk/; revision=22092

reactos/dll/win32/newdev/De.rc
reactos/dll/win32/newdev/En.rc
reactos/dll/win32/newdev/Es.rc
reactos/dll/win32/newdev/Hu.rc
reactos/dll/win32/newdev/Ru.rc
reactos/dll/win32/newdev/newdev.h
reactos/dll/win32/newdev/resource.h
reactos/dll/win32/newdev/wizard.c

index a58fa41..25c34ea 100644 (file)
@@ -32,6 +32,18 @@ BEGIN
                     BS_AUTOCHECKBOX | WS_TABSTOP,120,170,180,11
 END
 
+IDD_INSTALLFAILED 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 failed",IDC_FINISHTITLE,120,8,195,24
+    LTEXT           "The device could not be installed because an unexpected error happened.",
+                    IDC_STATIC,120,40,195,19
+    LTEXT           "UNKNOWN DEVICE",IDC_DEVICE,134,55,164,11
+END
+
 IDD_CHSOURCE DIALOG DISCARDABLE  0, 0, 317, 143
 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
 CAPTION "Hardwareinstallation"
index 2d7b6d4..b68bc99 100644 (file)
@@ -32,6 +32,18 @@ BEGIN
                     BS_AUTOCHECKBOX | WS_TABSTOP,120,170,180,11
 END
 
+IDD_INSTALLFAILED 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 failed",IDC_FINISHTITLE,120,8,195,24
+    LTEXT           "The device could not be installed because an unexpected error happened.",
+                    IDC_STATIC,120,40,195,19
+    LTEXT           "UNKNOWN DEVICE",IDC_DEVICE,134,55,164,11
+END
+
 IDD_CHSOURCE DIALOG DISCARDABLE  0, 0, 317, 143
 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
 CAPTION "Device installation"
index 76dd335..57cdd21 100644 (file)
@@ -32,6 +32,18 @@ BEGIN
                     BS_AUTOCHECKBOX | WS_TABSTOP,120,170,180,11
 END
 
+IDD_INSTALLFAILED 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 failed",IDC_FINISHTITLE,120,8,195,24
+    LTEXT           "The device could not be installed because an unexpected error happened.",
+                    IDC_STATIC,120,40,195,19
+    LTEXT           "UNKNOWN DEVICE",IDC_DEVICE,134,55,164,11
+END
+
 IDD_CHSOURCE DIALOG DISCARDABLE  0, 0, 317, 143
 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
 CAPTION "Instalación de Dispositivos"
index 8b8d617..b7048df 100644 (file)
@@ -8,11 +8,14 @@ CAPTION "Hardver telep
 FONT 8, "MS Shell Dlg"\r
 BEGIN\r
     LTEXT           "welcome??",IDC_WELCOMETITLE,115,8,195,24\r
-    LTEXT           "A telepítõ a következõ hardverhez telepít fel eszközmeghatjtót:",IDC_STATIC,115,40,195,16\r
+    LTEXT           "A telepítõ a következõ hardverhez telepít fel eszközmeghatjtót:",\r
+                    IDC_STATIC,120,40,195,16\r
     LTEXT           "Kattints a Tovább gombra a folytatáshoz.",IDC_STATIC,115,169,195,17\r
     LTEXT           "Ismeretlen eszköz!",IDC_DEVICE,129,55,164,11\r
-    CONTROL         "Automatikus telepítés",IDC_RADIO_AUTO,"Button",BS_AUTORADIOBUTTON,115,112,178,13\r
-    CONTROL         "Eszközmeghajtó kiválasztása",IDC_RADIO_MANUAL,"Button",BS_AUTORADIOBUTTON,115,133,164,14\r
+    CONTROL         "Automatikus telepítés",IDC_RADIO_AUTO,"Button",\r
+                    BS_AUTORADIOBUTTON,120,112,178,13\r
+    CONTROL         "Eszközmeghajtó kiválasztása",IDC_RADIO_MANUAL,\r
+                    "Button",BS_AUTORADIOBUTTON,120,133,164,14\r
 END\r
 \r
 IDD_NODRIVER DIALOG DISCARDABLE  0, 0, 317, 193\r
@@ -22,9 +25,24 @@ CAPTION "Hardver telep
 FONT 8, "MS Shell Dlg"\r
 BEGIN\r
     LTEXT           "A telepítés sikertelen.",IDC_FINISHTITLE,115,8,195,24\r
-    LTEXT           "Az eszközmeghajtó nem található.",IDC_STATIC,115,40,195,19\r
-    LTEXT           "Kattints a Vissza gombra, és az Eszközmeghajtó kiválasztása gombra, ha tudod, hol van az eszközmeghajtó.",IDC_STATIC,113,98,181,24\r
-    CONTROL         "Ne mutasd ezt többször",IDC_DONOTSHOWDLG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,170,180,11\r
+    LTEXT           "Az eszközmeghajtó nem található.",\r
+                    IDC_STATIC,120,40,195,19\r
+    LTEXT           "Kattints a Vissza gombra, és az Eszközmeghajtó kiválasztása gombra, ha tudod, hol van az eszközmeghajtó.",\r
+                    IDC_STATIC,120,98,181,24\r
+    CONTROL         "Ne mutasd ezt többször",IDC_DONOTSHOWDLG,"Button",\r
+                    BS_AUTOCHECKBOX | WS_TABSTOP,120,170,180,11\r
+END\r
+\r
+IDD_INSTALLFAILED DIALOG DISCARDABLE  0, 0, 317, 193\r
+STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | \r
+    WS_SYSMENU\r
+CAPTION "Device installation"\r
+FONT 8, "MS Shell Dlg"\r
+BEGIN\r
+    LTEXT           "Installation failed",IDC_FINISHTITLE,120,8,195,24\r
+    LTEXT           "The device could not be installed because an unexpected error happened.",\r
+                    IDC_STATIC,120,40,195,19\r
+    LTEXT           "UNKNOWN DEVICE",IDC_DEVICE,134,55,164,11\r
 END\r
 \r
 IDD_CHSOURCE DIALOG DISCARDABLE  0, 0, 317, 143\r
@@ -32,12 +50,17 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
 CAPTION "Hardver telepítõ"\r
 FONT 8, "MS Shell Dlg"\r
 BEGIN\r
-    CONTROL         "Keresés ezeken a helyeken",IDC_RADIO_SEARCHHERE,"Button",BS_AUTORADIOBUTTON,27,11,239,13\r
-    CONTROL         "Eszközmeghajtó kiválasztása",IDC_RADIO_CHOOSE,"Button",BS_AUTORADIOBUTTON,27,98,171,12\r
-    CONTROL         "Keresés cserélhetõ lemezeken",IDC_CHECK_MEDIA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47,33,163,9\r
-    CONTROL         "A következõ útvonalon keressen",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47,54,162,10\r
+    CONTROL         "Keresés ezeken a helyeken",IDC_RADIO_SEARCHHERE,"Button",\r
+                    BS_AUTORADIOBUTTON,27,11,239,13\r
+    CONTROL         "Eszközmeghajtó kiválasztása",IDC_RADIO_CHOOSE,"Button",\r
+                    BS_AUTORADIOBUTTON,27,98,171,12\r
+    CONTROL         "Keresés cserélhetõ lemezeken",IDC_CHECK_MEDIA,"Button",\r
+                    BS_AUTOCHECKBOX | WS_TABSTOP,47,33,163,9\r
+    CONTROL         "A következõ útvonalon keressen",IDC_CHECK_PATH,"Button",\r
+                    WS_TABSTOP,47,54,162,10\r
     PUSHBUTTON      "Böngészés",IDC_BROWSE,248,69,45,14\r
-    COMBOBOX        IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_AUTOHSCROLL\r
+    COMBOBOX        IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | \r
+                    WS_VSCROLL | WS_TABSTOP  | CBS_AUTOHSCROLL\r
 END\r
 \r
 IDD_SEARCHDRV DIALOG DISCARDABLE  0, 0, 317, 143\r
@@ -62,9 +85,11 @@ STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION |
 CAPTION "Hardver telepítõ"\r
 FONT 8, "MS Shell Dlg"\r
 BEGIN\r
-    LTEXT           "A telepítés sikeresen befejezõdött",IDC_FINISHTITLE,115,8,195,11\r
-    LTEXT           "A telepítõ feltelepítette az eszközmeghajtókat a következõ eszközhöz:",IDC_STATIC,115,32,195,19\r
-    LTEXT           "A kilépéshez kattints a Befejezés gombra.",IDC_STATIC,115,174,179,11\r
+    LTEXT           "A telepítés sikeresen befejezõdött",IDC_FINISHTITLE,120,8,195,11\r
+    LTEXT           "A telepítõ feltelepítette az eszközmeghajtókat a következõ eszközhöz:",\r
+                    IDC_STATIC,120,32,195,19\r
+    LTEXT           "A kilépéshez kattints a Befejezés gombra.",IDC_STATIC,120,174,\r
+                    179,11\r
     LTEXT           "Ismeretlen eszköz!",IDC_DEVICE,148,53,147,12\r
 END\r
 \r
index d3fd12a..8b613b6 100644 (file)
@@ -32,6 +32,18 @@ BEGIN
                     BS_AUTOCHECKBOX | WS_TABSTOP,120,170,180,11
 END
 
+IDD_INSTALLFAILED 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 failed",IDC_FINISHTITLE,120,8,195,24
+    LTEXT           "The device could not be installed because an unexpected error happened.",
+                    IDC_STATIC,120,40,195,19
+    LTEXT           "UNKNOWN DEVICE",IDC_DEVICE,134,55,164,11
+END
+
 IDD_CHSOURCE DIALOG DISCARDABLE  0, 0, 317, 143
 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
 CAPTION "Óñòàíîâêà îáîðóäîâàíèÿ"
index dcb8ceb..50454c8 100644 (file)
@@ -27,7 +27,8 @@ typedef struct _DEVINSTDATA
        LPTSTR CustomSearchPath; /* MULTI_SZ string */
 } DEVINSTDATA, *PDEVINSTDATA;
 
-#define WM_SEARCH_FINISHED (WM_USER + 10)
+#define WM_SEARCH_FINISHED  (WM_USER + 10)
+#define WM_INSTALL_FINISHED (WM_USER + 11)
 
 /* newdev.c */
 BOOL
index 35ce4b6..08ebc7e 100644 (file)
@@ -24,6 +24,7 @@
 #define IDD_SEARCHDRV                   2
 #define IDD_INSTALLDRV                  3
 #define IDD_NODRIVER                    4
-#define IDD_FINISHPAGE                  5
+#define IDD_INSTALLFAILED               5
+#define IDD_FINISHPAGE                  6
 
 #endif /* RESOURCE_H */
index 7801ead..c86b229 100644 (file)
@@ -335,6 +335,19 @@ FindDriverProc(
        return 0;
 }
 
+static DWORD WINAPI
+InstallDriverProc(
+       IN LPVOID lpParam)
+{
+       PDEVINSTDATA DevInstData;
+       BOOL res;
+
+       DevInstData = (PDEVINSTDATA)lpParam;
+       res = InstallCurrentDriver(DevInstData);
+       PostMessage(DevInstData->hDialog, WM_INSTALL_FINISHED, res ? 0 : 1, 0);
+       return 0;
+}
+
 static VOID
 PopulateCustomPathCombo(
        IN HWND hwndCombo)
@@ -408,7 +421,7 @@ static VOID
 SaveCustomPath(
        IN HWND hwndCombo)
 {
-       FIXME("Stub.");
+       FIXME("Stub\n");
 }
 
 static INT_PTR CALLBACK
@@ -606,7 +619,7 @@ CHSourceDlgProc(
                                                if (PrepareFoldersToScan(DevInstData, hwndDlg))
                                                        PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_SEARCHDRV);
                                                else
-                                                       /* FIXME: unknown error */;
+                                                       PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_INSTALLFAILED);
                                        }
                                        else
                                                /* FIXME */;
@@ -675,11 +688,7 @@ SearchDrvDlgProc(
                        if (wParam == 0)
                                PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_NODRIVER);
                        else
-                       {
-                               /* FIXME: Shouldn't belong here... */
-                               InstallCurrentDriver(DevInstData);
-                               PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_FINISHPAGE);
-                       }
+                               PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_INSTALLDRV);
                        break;
                }
 
@@ -726,6 +735,86 @@ InstallDrvDlgProc(
        IN WPARAM wParam,
        IN LPARAM lParam)
 {
+       PDEVINSTDATA DevInstData;
+       DWORD dwThreadId;
+
+       /* Retrieve pointer to the global setup data */
+       DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
+
+       switch (uMsg)
+       {
+               case WM_INITDIALOG:
+               {
+                       HWND hwndControl;
+                       DWORD dwStyle;
+
+                       /* Get pointer to the global setup data */
+                       DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
+                       SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData);
+
+                       DevInstData->hDialog = hwndDlg;
+                       hwndControl = GetParent(hwndDlg);
+
+                       /* Center the wizard window */
+                       CenterWindow(hwndControl);
+
+                       SendDlgItemMessage(
+                               hwndDlg,
+                               IDC_DEVICE,
+                               WM_SETTEXT,
+                               0,
+                               (LPARAM)DevInstData->drvInfoData.Description);
+
+                       /* Hide the system menu */
+                       dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
+                       SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
+                       break;
+               }
+
+               case WM_INSTALL_FINISHED:
+               {
+                       CloseHandle(hThread);
+                       hThread = 0;
+                       if (wParam == 0)
+                               PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_FINISHPAGE);
+                       else
+                               PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_INSTALLFAILED);
+                       break;
+               }
+
+               case WM_NOTIFY:
+               {
+                       LPNMHDR lpnm = (LPNMHDR)lParam;
+
+                       switch (lpnm->code)
+                       {
+                               case PSN_SETACTIVE:
+                                       PropSheet_SetWizButtons(GetParent(hwndDlg), !PSWIZB_NEXT | !PSWIZB_BACK);
+                                       hThread = CreateThread(NULL, 0, InstallDriverProc, DevInstData, 0, &dwThreadId);
+                                       break;
+
+                               case PSN_KILLACTIVE:
+                                       if (hThread != 0)
+                                       {
+                                               SetWindowLong(hwndDlg, DWL_MSGRESULT, TRUE);
+                                               return TRUE;
+                                       }
+                                       break;
+
+                               case PSN_WIZNEXT:
+                                       /* Handle a Next button click, if necessary */
+                                       break;
+
+                               default:
+                                       break;
+                       }
+                       break;
+               }
+
+               default:
+                       break;
+       }
+
        return FALSE;
 }
 
@@ -739,7 +828,7 @@ NoDriverDlgProc(
        PDEVINSTDATA DevInstData;
 
        /* Get pointer to the global setup data */
-       DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+       DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
 
        switch (uMsg)
        {
@@ -752,8 +841,8 @@ NoDriverDlgProc(
                        SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData);
 
                        hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
-                       ShowWindow (hwndControl, SW_HIDE);
-                       EnableWindow (hwndControl, FALSE);
+                       ShowWindow(hwndControl, SW_HIDE);
+                       EnableWindow(hwndControl, FALSE);
 
                        /* Set title font */
                        SendDlgItemMessage(
@@ -835,6 +924,81 @@ NoDriverDlgProc(
        return FALSE;
 }
 
+static INT_PTR CALLBACK
+InstallFailedDlgProc(
+       IN HWND hwndDlg,
+       IN UINT uMsg,
+       IN WPARAM wParam,
+       IN LPARAM lParam)
+{
+       PDEVINSTDATA DevInstData;
+
+       /* 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);
+
+                       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 FALSE;
+}
+
 static INT_PTR CALLBACK
 FinishDlgProc(
        IN HWND hwndDlg,
@@ -845,7 +1009,7 @@ FinishDlgProc(
        PDEVINSTDATA DevInstData;
 
        /* Retrieve pointer to the global setup data */
-       DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+       DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
 
        switch (uMsg)
        {
@@ -858,8 +1022,8 @@ FinishDlgProc(
                        SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData);
 
                        hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
-                       ShowWindow (hwndControl, SW_HIDE);
-                       EnableWindow (hwndControl, FALSE);
+                       ShowWindow(hwndControl, SW_HIDE);
+                       EnableWindow(hwndControl, FALSE);
 
                        SendDlgItemMessage(
                                hwndDlg,
@@ -973,12 +1137,18 @@ DisplayWizard(
        psp.pszTemplate = MAKEINTRESOURCE(IDD_INSTALLDRV);
        ahpsp[IDD_INSTALLDRV] = CreatePropertySheetPage(&psp);
 
-       /* Create the Install failed page */
+       /* Create the No driver page */
        psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
        psp.pfnDlgProc = NoDriverDlgProc;
        psp.pszTemplate = MAKEINTRESOURCE(IDD_NODRIVER);
        ahpsp[IDD_NODRIVER] = CreatePropertySheetPage(&psp);
 
+       /* Create the Install failed page */
+       psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
+       psp.pfnDlgProc = InstallFailedDlgProc;
+       psp.pszTemplate = MAKEINTRESOURCE(IDD_INSTALLFAILED);
+       ahpsp[IDD_INSTALLFAILED] = CreatePropertySheetPage(&psp);
+
        /* Create the Finish page */
        psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
        psp.pfnDlgProc = FinishDlgProc;
@@ -990,7 +1160,7 @@ DisplayWizard(
        psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
        psh.hInstance = hDllInstance;
        psh.hwndParent = hwndParent;
-       psh.nPages = 6;
+       psh.nPages = IDD_FINISHPAGE + 1;
        psh.nStartPage = startPage;
        psh.phpage = ahpsp;
        psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);