delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/09/04/11:10:51

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <39B3BB23.852CAEBF@ece.gatech.edu>
Date: Mon, 04 Sep 2000 11:09:23 -0400
From: "Charles S. Wilson" <cwilson AT ece DOT gatech DOT edu>
X-Mailer: Mozilla 4.75 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Robert Collins <robert DOT collins AT itdomain DOT com DOT au>, cygwin AT sources DOT redhat DOT com
Subject: Re: DLL naming conventions
References: <17B78BDF120BD411B70100500422FC6309E0C3 AT IIS000> <001b01c0166d$d8f49d90$f7c723cb AT lifelesswks> <39B3B044 DOT 765E2666 AT ece DOT gatech DOT edu>



> Not necessarily, if the PATH settings (or insuring that all dll's and
> exe's go into the same directory) are sufficient to prevent problems.  I
> don't think so, personally.  As distasteful and painful as renaming all
> the dll's is, it *may*, repeat *may*, be the best option.  I believe
> Chris is proactively doing some research; it is possible that we can do
> something else, and avoid the 'cyg' prefix -- like using the 'AppPath'
> registry or something.
> 
> It's just that there is an ingrained desire to stay as unix-like as
> possible -- and that means, libraries start with 'lib', not 'cyg'.  If
> AppPath can fix the problem, then I'd prefer that cygwin's install.exe
> set the appropriate registry entry whenever installing an executable.
> This won't catch *everything*, but dagnabbit, I'm tired of packages
> installing themselves with cp (which break on cygwin thanks to the .exe
> suffix).  They oughta use install.

Here's the search order for DLL's when an AppPath key is set for the
executable in the registry:

1.The directories listed in the App Path registry key 

2.The directory where the executable module for the current process is
located. 

3.The current directory. 

4.The Windows system directory. The GetSystemDirectory function
retrieves the path of this directory. 

5.The Windows directory. The GetWindowsDirectory function retrieves the
path of this directory. 

6.The directories listed in the PATH environment variable.


See http://codeguru.earthweb.com/dll/AppPath.shtml

So, if all .exe's are installed using 'install.exe', and install.exe is
made smart enough to create an AppPath key for each one -- the problem
is solved!

(sotto voce: ermmm...three minor problems:

1. The AppPath entry must be in windows-format:
C:\cygwin\bin;C:\cygwin\usr\local\bin  NOT /bin:/usr/local/bin.  What
happens when you reinstall cygwin to a different location -- say
D:\cygwin -- and change the mount points?

2. The AppPath entry is keyed by the program name:

HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\foo.exe
  default value is string   = "C:\cygwin\usr\local\bin\foo.exe"
  string value named "Path" = "C:\cygwin\bin;C:\cygwin\usr\local\bin"

What if you have two foo.exe's -- one cygwin, and one mingw ?

3. It doesn't work if there is already a dll with the same name, loaded
into memory (for Win95, Win98, and WinNT; the following analysis doesn't
apply to Win98SE or W2K)

e.g. 
  c:\cygwin\usr\local\bin\app1.exe
    (app1.exe has AppPath key so that c:\cygwin\usr\bin is searched
first)
  c:\cygwin\usr\bin\my-dll.dll

  c:\mingw\usr\local\bin\app2.exe
    (app2.exe has AppPath key so that c:\mingw\usr\bin is searched
first)
  c:\mingw\usr\bin\my-dll.dll

Run app1.exe -- fine, c:\cygwin\usr\bin\my-dll.dll gets loaded.
Run app2.exe -- *will not load* c:\mingw\usr\bin\my-dll.dll into memory.

This analysis extrapolated from description in:
http://codeguru.earthweb.com/mfc/comments/6493.shtml

Maybe the problem isn't solved by AppPath, after all.

--Chuck

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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