delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/04/07/15:07:25

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RFC: 1.5.14-1 cygwin1.dll could not be found
Date: Thu, 7 Apr 2005 20:06:54 +0100
MIME-Version: 1.0
In-Reply-To: <SERRANOR6mJB526tr5X000000a8@SERRANO.CAM.ARTIMI.COM>
Message-ID: <SERRANOcUbvBDxroC6P000000aa@SERRANO.CAM.ARTIMI.COM>
X-OriginalArrivalTime: 07 Apr 2005 19:06:53.0270 (UTC) FILETIME=[F5B23760:01C53BA4]
Note-from-DJ: This may be spam

------=_NextPart_000_0057_01C53BAD.5805C000
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

----Original Message----
>From: Dave Korn
>Sent: 07 April 2005 19:47


>   Just to save any duplication of effort, I thought I should mention that
> I'm taking a look at this over the next few days and weekend.  If anyone
> else was too, please drop me a line and we'll co-ordinate.


  Well, I have a crude patch going, and it's that time of night that I'm
leaving the office and going home now[*], so here's what I've done so far,
just in case anyone else wants to have a go and see if it works for them. 

  NOTE that this is not a patch submission, just an RFC, for the following
reasons:

1)  It's a horrible bit of inefficient cut'n'paste coding based on a quick
skim through the code and not a deep understanding of it.  Some of it is
definitely superfluous, such as checking for the cygwin package by name
twice.

2)  It's got a couple of MessageBox calls in it, which are no good for
production coding, but are the sort of thing I like to use in debug and
development in order to be very sure that events are occurring in the order
I think they are.

3)  There's no changelog entry!

4)  I'm not sure how correct it is!  For instance, do I need to worry about
whether the cygwin package is going to be an uninstall-and-reinstall or a
replace-in-place?  

5)  It may or may not be generating a spurious 'Replaced files in use -
reboot needed' warning (but then I realised I had left a bash shell running
in the background while testing an upgraded install)

6)  Possibly related to that, I'm now seeing lots of '_impure_ptr entrypoint
not found' dialog boxes.  Hmm, this now looks like it totally failed to
either remove or rename the old .dll, but maybe I've really bodged my test
by leaving that shell window open.  D'oh.



Oh well, looks like it needs a bit more testing, but I'm off home now, so
here it is for anyone who wants to take a look at it.





    cheers,
      DaveK
[*]  Oh alright, I admit it.  I'm going to the pub first.  *Then* I'm going
home :D <hic>
-- 
Can't think of a witty .sigline today....

------=_NextPart_000_0057_01C53BAD.5805C000
Content-Type: application/octet-stream;
	name="setup-save-cygdll-til-last-patch.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="setup-save-cygdll-til-last-patch.diff"

Index: install.cc
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/cygwin-apps/setup/install.cc,v
retrieving revision 2.72
diff -p -u -r2.72 install.cc
--- install.cc	5 Apr 2005 21:37:41 -0000	2.72
+++ install.cc	7 Apr 2005 18:56:08 -0000
@@ -527,11 +527,19 @@ do_install_thread (HINSTANCE h, HWND own
 	}
     }
=20
+  /* save cygwin base files for last */
+  packagemeta *cygwin_package =3D NULL;
   /* start with uninstalls - remove files that new packages may replace */
   for (vector <packagemeta *>::iterator i =3D db.packages.begin ();
        i !=3D db.packages.end (); ++i)
     {
       packagemeta & pkg =3D **i;
+      if (pkg.name =3D=3D "cygwin")
+      {
+          MessageBox (NULL, "Found cygwin!", "Got it!", MB_OK);
+          cygwin_package =3D *i;
+          continue;
+      }
       if (pkg.installed && (!pkg.desired || (pkg.desired !=3D pkg.installe=
d &&
 	  pkg.desired.picked ())))
 	myInstaller.uninstallOne (pkg);
@@ -545,6 +553,12 @@ do_install_thread (HINSTANCE h, HWND own
        i !=3D db.packages.end (); ++i)
     {
       packagemeta & pkg =3D **i;
+      if (pkg.name =3D=3D "cygwin")
+      {
+          MessageBox (NULL, "Found cygwin!", "Got it!", MB_OK);
+          cygwin_package =3D *i;
+          continue;
+      }
       if (pkg.installed && pkg.desired.picked())
 	{
 	  try {
@@ -566,6 +580,57 @@ do_install_thread (HINSTANCE h, HWND own
 	}
     }
=20
+    /* Now, last of all, uninstall cygwin.  Hopefully leaving the old one =
there
+     should have been sufficient for the uninstall scripts to run.  We sho=
uld
+     also make sure it's the very first thing that we re-install */
+  if (cygwin_package)
+  {
+      MessageBox (NULL, "*now* uninstall cygwin!", "Got it!", MB_OK);
+    if (cygwin_package->installed && (!cygwin_package->desired || (cygwin_=
package->desired !=3D cygwin_package->installed &&
+	  cygwin_package->desired.picked ())))
+        myInstaller.uninstallOne (*cygwin_package);
+    else if (cygwin_package->installed && cygwin_package->desired.picked())
+	{
+	  try {
+	    int e =3D 0;
+	    e +=3D myInstaller.replaceOne (*cygwin_package);
+ 	    if (e)
+	      errors++;
+	  }
+	  catch (exception *e) {
+	    if (yesno (owner, IDS_INSTALL_ERROR, e->what()) !=3D IDYES)
+		{
+		  log (LOG_TIMESTAMP)
+                    << "User cancelled setup after install error" << endLo=
g;
+		  LogSingleton::GetInstance().exit (1);
+		  return;
+		}
+	  }
+	}
+    /* That either uninstalled it, or upgraded in place, now reinstall */
+      if (cygwin_package->desired && cygwin_package->desired.changeRequest=
ed())
+	{
+	  try
+	    {
+    	      int e =3D 0;
+      MessageBox (NULL, "now reinstall cygwin!", "Got it!", MB_OK);
+    	      e +=3D install_one (*cygwin_package);
+    	      if (e)
+		  errors++;
+	    }
+	  catch (exception *e)
+	    {
+	      if (yesno (owner, IDS_INSTALL_ERROR, e->what()) !=3D IDYES)
+		{
+		  log (LOG_TIMESTAMP)
+                    << "User cancelled setup after install error" << endLo=
g;
+		  LogSingleton::GetInstance().exit (1);
+		  return;
+		}
+	    }
+	}
+  }
+
   for (vector <packagemeta *>::iterator i =3D db.packages.begin ();
        i !=3D db.packages.end (); ++i)
     {


------=_NextPart_000_0057_01C53BAD.5805C000
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
------=_NextPart_000_0057_01C53BAD.5805C000--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019