FW: Install failing and leaving unusable system

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FW: Install failing and leaving unusable system

Dave Korn
On 30 October 2006 11:28, Dave Korn wrote:

>   How about just providing an extra option on the "choose installation
> type" page: "Re-run failed postinstall scripts", that just jumps
> immediately to that stage, and thereby cleans up any leftovers?  
>
>   ISTM that would provide all the same functionality in one nice neat
> package.  I'll look at whipping up a patch for consideration.

  I'm having a hard time figuring out how control flow works in this thing.  I
defined a new app-private WM:


Index: threebar.h
===================================================================
RCS file: /cvs/cygwin-apps/setup/threebar.h,v
retrieving revision 2.7
diff -p -u -r2.7 threebar.h
--- threebar.h 1 Nov 2003 05:58:46 -0000 2.7
+++ threebar.h 3 Nov 2006 15:57:36 -0000
@@ -34,6 +34,7 @@
 // desktop.h: WM_APP_UNATTENDED_FINISH WM_APP+8
 #define WM_APP_START_POSTINSTALL           WM_APP+9
 #define WM_APP_POSTINSTALL_THREAD_COMPLETE WM_APP+10
+#define WM_APP_JUMP_TO_POSTINSTALL         WM_APP+11
 
 class ThreeBarProgressPage:public PropertyPage
 {



and in the OnNext method of the source page, I send it if I want to skip to
the postinstall:



@@ -115,6 +122,14 @@ SourcePage::OnNext ()
   HWND h = GetHWND ();
 
   save_dialog (h);
+
+  if (source == IDC_FAILURE_RECOVERY)
+    {
+        MessageBox (h, "HELP!", "FOO", MB_OK);
+      // We want to go straight on to the postinstall.
+      Window::PostMessage (WM_APP_JUMP_TO_POSTINSTALL);
+    }
+
   return 0;
 }



where I've added a clause that I hoped would catch it:



Index: threebar.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/threebar.cc,v
retrieving revision 2.11
diff -p -u -r2.11 threebar.cc
--- threebar.cc 30 Mar 2006 20:30:50 -0000 2.11
+++ threebar.cc 3 Nov 2006 15:57:36 -0000
@@ -201,9 +201,18 @@ ThreeBarProgressPage::OnMessageApp (UINT
  Window::PostMessage (WM_APP_START_POSTINSTALL);
  break;
       }
+    case WM_APP_JUMP_TO_POSTINSTALL:
+      {
+        MessageBox (GetOwner ()->GetHWND (), "SPANG!", "BLORT", MB_OK);
+ // Install is bypassed and we want to go on to the postinstall.
+ GetOwner ()->SetActivePageByID (IDD_S_POSTINSTALL);
+ Window::PostMessage (WM_APP_START_POSTINSTALL);
+ break;
+      }
     case WM_APP_START_POSTINSTALL:
       {
  // Start the postinstall script thread.
+          abort ();
  do_postinstall (GetInstance (), GetHWND ());
  break;
       }


but nothing happens; the message gets sent, but it never arrives and setup.exe
just carries straight on to the 'choose install directory' page.

  I don't do an awful lot of win32/mfc coding, I'm sure I'm just going about
it the wrong way, can anyone point me in the right direction please?



    cheers,
      DaveK
--
Can't think of a witty .sigline today....