This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Determining the location of a Cygwin installation

> Rolf Campbell wrote:
> > You mean "cygpath -w -p /bin", because he said "I need to determine
> > the native path to the directory containing cygwin1.dll"
> He also said he needed to determine this from "outside the Cygwin
> environment" and I would think that cygpath is inside the Cygwin
> environment. Think about it. You're in cmd.exe and you want to tell
> where Cygwin is installed. How can you execute cygpath without knowing
> where cygpath is? The only way that would work is if Cygwin's bin path
> is already in PATH and this is not set by default when Cygwin is
> Personally I vote for a simple base like registry variable that plainly
> states where Cygwin was installed. It seems to me to make the most sense
> to have one globally accessible place where you can find Cygwin's
> installation path and then you can take it from there. Relying on
> anything within Cygwin's installation path presupposes that the person
> knows Cygwin's installation path! But this is just my opinion...

But as cgf (the Really Cool Manager) said the registry keys are not to be
relied on as they might not be there forever. Thinking about this I'd use
Win32 API calls (FindFirstFileEx and CreateFile) to search a drive for items
named "bin" and see if it's a) a folder and b) contains cygwin1.dll .


Elfyn McBratney
elfyn at exposure dot org dot uk

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]