Re: Determining the location of a Cygwin installation

2003-06-27 Thread Andrew DeFaria
[EMAIL PROTECTED] wrote:

We have a .bat script to run setup and the local post-install script 
for lots of extra tailoring. Much of this can also be found at my 
personal web page: 
http://members.optushome.com.au/lukekendall/xwin-network.html
Looked at your script. Like many people you assume that the end user 
will a) read your documentation and b) go through a few manual steps of 
unpacking and executing the resulting script. I was looking for 
something a little more automated as I have learned over the years that 
given any distribution of even computer professionals, about 70% of them 
will not read the directions nor perform any manual step until and 
unless it becomes a problem (at which point you're called over to do 
they thing for them!).



--
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/


Re: Determining the location of a Cygwin installation

2003-06-26 Thread luke . kendall
On 26 Mar, Andrew DeFaria wrote:
  Let me describe a problem scenerio (real world). 
   
  You have a bunch of people in your domain who rely on Cygwin but who do  
  not always keep up with the latest. Indeed often they are way behind.  
  These people do not bother to add Cygwin's bin directory to their PATH  
  either. A problem crops up and they call you. So you investigate and  
  think that perhaps updating their Cygwin to a relatively recent version  
  would correct their problem. So you do that. Then you think Gee,  
  wouldn't it be nice if I could keep everybody's Cygwin up to some  
  relatively recent (and stable) version... and you attempt to scriptize  
  this. The first road block you hit is trying to determine where the user  
  installed Cygwin - some in C:\Cygwin, others in D:\Cygwin and still  
  others in some other odd path. Now what do you to? 
   
  (Of course, going hand in hand with this would be a command line driven  
  setup.exe but perhaps we shouldn't go there just yet...) 

Sorry for jumping in late.

Basically that's what I've set up here.  We rsync one of the mirror
sites locally, so anyone can easily update.

We have a .bat script to run setup and the local post-install script
for lots of extra tailoring.  Much of this can also be found at my
personal web page:
http://members.optushome.com.au/lukekendall/xwin-network.html

Yes, to sort out the cygwin path you'd have to run a registry examining
command line tool (and yes, I think that running regtool off a server on
your local network that has Cygwin installed should do the trick).  I
must admit I haven't bothered with that.  My approach was to integrate
the installation of Cygwin into the setup of a new PC when it's
configured by SysAdmin.  They know to restrict their choices to either
C:\cygwin or D:\cygwin.

I also modify our startx.bat script to hard-wire in the correct
location during our post-install stuff.

luke


--
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/



RE: Determining the location of a Cygwin installation

2003-03-29 Thread Hannu E K Nevalainen (garbage mail)
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf
 Of Rolf Campbell

  Software packages belong in  C:\Program\*  and nowhere else
 (Note that this
  is equal to C:\Program Files\* on ENGLISH Win98.

 Ahhh... yeah.  So, what is the rest of the disk for?  Why not just put
 everything in a directory called C:\Everything?

 Ahh... Microsoft infestation detected. ;-)

 I should have written  C:\Program\package-name\  above...
Happy now?


 I _hate_ having C:\foo\ c:\bar\ c:\this\ c:\that\ directories. They DO
belong in C:\Program\ (or whatever) _AND NOT IN THE ROOT_ :-I

 Any files belonging to a software package should be kept in a storage that
identifies them as beeing part of that package. IMO a well structured
operating system allows this (e.g. AmigaOS, Unix/Linux)

 Therefore cygwin is in C:\Program\cygwin\ here. As it has kept all its
files within that directory I consider it to be well behaving. (i.e. I
talk good about it among friends ;-)

 Example: Install Corel Draw (Version 8 is the last one I tried), tell it to
install in C:\Program\CorelDraw\ - what does it do? It STILL creates a
C:\corel\ directory; to hold some essential files.

/Hannu E K Nevalainen, Mariefred, Sweden

--END OF MESSAGE--


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Determining the location of a Cygwin installation

2003-03-27 Thread Hannu E K Nevalainen (garbage mail)
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf
 Of Rolf Campbell
--8--
 And about searching for bin/cygwin1.dll.  You could first try
 C:\cygwin\bin\ (which should match 99% of all cases),

 Sorry. I count for more than 1% ;-)
  just this time; to break your assumption

Software packages belong in  C:\Program\*  and nowhere else (Note that this
is equal to C:\Program Files\* on ENGLISH Win98.

 and only if that
 fails, look for the DLL the hard way.

 Ouch...

/Hannu E K Nevalainen, Mariefred, Sweden

--END OF MESSAGE--


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Determining the location of a Cygwin installation

2003-03-27 Thread Rolf Campbell
And about searching for bin/cygwin1.dll.  You could first try
C:\cygwin\bin\ (which should match 99% of all cases),
 Sorry. I count for more than 1% ;-)
  just this time; to break your assumption
Software packages belong in  C:\Program\*  and nowhere else (Note that this
is equal to C:\Program Files\* on ENGLISH Win98.
Ahhh... yeah.  So, what is the rest of the disk for?  Why not just put 
everything in a directory called C:\Everything?



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


RE: Determining the location of a Cygwin installation

2003-03-26 Thread John Morrison
You didn't say whether you wanted it for a script or exe, for
a script...

cygpath -w -p /

works for me :)

J.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf
 Of John Dallaway
 Sent: Wednesday, 26 March 2003 6:33 pm
 To: [EMAIL PROTECTED]
 Subject: Determining the location of a Cygwin installation
 
 
 I need to determine the location of an existing Cygwin net installation 
 programatically. More precisely, I need to determine the native 
 path to the 
 directory containing cygwin1.dll from outside the Cygwin environment. I 
 could interrogate the registry for mount points, but in the worst case I 
 would have to look under both HKEY_CURRENT_USER and 
 HKEY_LOCAL_MACHINE for 
 both the /bin and / mount points. Is there a more robust method?
 
 John Dallaway
 
 
 --
 Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
 Bug reporting: http://cygwin.com/bugs.html
 Documentation: http://cygwin.com/docs.html
 FAQ:   http://cygwin.com/faq/
 

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Determining the location of a cygwin installation

2003-03-26 Thread Christopher Faylor
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf
 Of John Dallaway
 Sent: Wednesday, 26 March 2003 6:33 pm
 To: [EMAIL PROTECTED]
 Subject: Determining the location of a Cygwin installation
 
 I need to determine the location of an existing Cygwin net installation 
 programatically.

On Wed, Mar 26, 2003 at 06:45:42PM -, John Morrison wrote:
You didn't say whether you wanted it for a script or exe, for
a script...

cygpath -w -p /

works for me :)

That's the only sure-fire way to work since there is no guarantee that
the registry items will be around forever.  In fact, I guarantee that they
won't be.

If you are talking about writing an actual cygwin-linked c program rather
than a script then you'd use the cygwin_conv_to_full_win32_path call :

http://cygwin.com/cygwin-api/func-cygwin-conv-to-full-win32-path.html

cgf


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Determining the location of a Cygwin installation

2003-03-26 Thread Rolf Campbell
You mean cygpath -w -p /bin, because he said I need to determine the 
native path to the directory containing cygwin1.dll

John Morrison wrote:
You didn't say whether you wanted it for a script or exe, for
a script...
cygpath -w -p /

works for me :)

J.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf
Of John Dallaway
Sent: Wednesday, 26 March 2003 6:33 pm
To: [EMAIL PROTECTED]
Subject: Determining the location of a Cygwin installation
I need to determine the location of an existing Cygwin net installation 
programatically. More precisely, I need to determine the native 
path to the 
directory containing cygwin1.dll from outside the Cygwin environment. I 
could interrogate the registry for mount points, but in the worst case I 
would have to look under both HKEY_CURRENT_USER and 
HKEY_LOCAL_MACHINE for 
both the /bin and / mount points. Is there a more robust method?

John Dallaway

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: Determining the location of a Cygwin installation

2003-03-26 Thread Andrew DeFaria
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 installed.

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...



John Morrison wrote:

You didn't say whether you wanted it for a script or exe, for
a script...
cygpath -w -p /

works for me :)

J.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf
Of John Dallaway
Sent: Wednesday, 26 March 2003 6:33 pm
To: [EMAIL PROTECTED]
Subject: Determining the location of a Cygwin installation
I need to determine the location of an existing Cygwin net 
installation programatically. More precisely, I need to determine 
the native path to the directory containing cygwin1.dll from outside 
the Cygwin environment. I could interrogate the registry for mount 
points, but in the worst case I would have to look under both 
HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE for both the /bin and / 
mount points. Is there a more robust method?

John Dallaway

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/







--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: Determining the location of a Cygwin installation

2003-03-26 Thread Elfyn McBratney
 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
installed.

 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 .


Regards,

Elfyn McBratney
[EMAIL PROTECTED]
www.exposure.org.uk



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Determining the location of a Cygwin installation

2003-03-26 Thread Andrew DeFaria
Elfyn McBratney wrote:

But as cgf (the Really Cool Manager) said the registry keys are not to 
be relied on as they might not be there forever. 
Yeah but what I'm saying is that there should be a commitment to at 
least one registry entry which denotes the [active] installation path of 
Cygwin. IOW I was sort of requesting it. Again, it's only my opinion. 
But to me it seems logical that you gotta know where to start... and the 
registry is there, partially for such a purpose

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 .
Sounds like a potentially expensive proposition.



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: Determining the location of a Cygwin installation

2003-03-26 Thread Igor Pechtchanski
On Wed, 26 Mar 2003, Elfyn McBratney wrote:

  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
  installed.
 
  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 .

 Regards,
 Elfyn McBratney

I think you're putting too much into cgf's words.  He didn't say don't
use the registry, he said if you use the registry, beware of changes.
There will *always* be a way to determine where Cygwin is installed (if
not the registry, then something else), if only because it's needed for
setup.exe, and likely nothing so drastic as the full drive search you
propose.  So, the short answer is: you can use the registry for now, and
when in doubt, do what setup.exe does - that should always be up-to-date.
:-)
Igor
P.S. Maybe we could factor out the code that detects a Cygwin installation
from setup into a library, and distribute a small cygdetect.exe that links
with it?
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Determining the location of a Cygwin installation

2003-03-26 Thread Marcel Telka
On Wed, Mar 26, 2003 at 12:23:31PM -0800, Andrew DeFaria wrote:
 Elfyn McBratney wrote:
 
 But as cgf (the Really Cool Manager) said the registry keys are not to 
 be relied on as they might not be there forever. 
 
 Yeah but what I'm saying is that there should be a commitment to at 
 least one registry entry which denotes the [active] installation path of 

This goal could be reached by adding the directory into the PATH.
If this is not done be default using setup.exe (which is not), then you
could add it by hand...
I don't see any problem with this.

If you want to add this behaviour into setup.exe, then PTC IMHO. :-)

-- 
+---+
| Marcel Telka   e-mail:   [EMAIL PROTECTED]  |
|homepage: http://telka.sk/ |
|jabber:   [EMAIL PROTECTED] |
+---+

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Determining the location of a Cygwin installation

2003-03-26 Thread Tino Lange
 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 installed.

This is not true! There's a trick:
At least under = Windows 2000 you can just put 'cygpath.exe' (and its
path) in your so called ApplicationPaths.
This is a Registry location for several utils you can just call by name
- no more needed.
Have a look at your:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
When you start such an application it don't need to be in the path of
the machine.

Solution:
Just put 'cygpath.exe' in your Application path - then you're able to
use it from everywhere on your machine.
So you can find the CYGWIN root with cygpath -w /.

You might also want to have a look at this great tool from Gergory Braun
to easily maintain your AppPaths Applications:
http://www.gregorybraun.com/AppPaths.html

Cheers,

Tino

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Determining the location of a Cygwin installation

2003-03-26 Thread Marcel Telka
On Wed, Mar 26, 2003 at 03:35:47PM -0500, Igor Pechtchanski wrote:
 P.S. Maybe we could factor out the code that detects a Cygwin installation
 from setup into a library, and distribute a small cygdetect.exe that links
 with it?

... and cygdetect.exe will be placed in /bin :-)

-- 
+---+
| Marcel Telka   e-mail:   [EMAIL PROTECTED]  |
|homepage: http://telka.sk/ |
|jabber:   [EMAIL PROTECTED] |
+---+

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Determining the location of a Cygwin installation

2003-03-26 Thread Igor Pechtchanski
On Wed, 26 Mar 2003, Marcel Telka wrote:

 On Wed, Mar 26, [EMAIL PROTECTED]:35:47PM -0500, Igor Pechtchanski wrote:
  P.S. Maybe we could factor out the code that detects a Cygwin installation
  from setup into a library, and distribute a small cygdetect.exe that links
  with it?

 ... and cygdetect.exe will be placed in /bin :-)

That wouldn't matter.  Like cygcheck.exe and setup.exe, it'll be a MinGW
application, independent of cygwin1.dll.  You'd be able to download it
from the web (preferably from cygwin.com), and running it would output the
Windows path to /bin.
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Determining the location of a cygwin installation

2003-03-26 Thread John Dallaway
On Wednesday 26 Mar 2003 18:56, Christopher Faylor wrote:

  I need to determine the location of an existing Cygwin net
  installation programatically.

 On Wed, Mar 26, 2003 at 06:45:42PM -, John Morrison wrote:

 cygpath -w -p /
 
 That's the only sure-fire way to work since there is no guarantee that
 the registry items will be around forever.  In fact, I guarantee that
 they won't be.

 If you are talking about writing an actual cygwin-linked c program rather
 than a script then you'd use the cygwin_conv_to_full_win32_path call

Both these approaches assume that the script or executable knows where /bin 
is already, either to add to the PATH so that cygwin1.dll is found or to 
invoke the cygpath tool.

It would be useful for the net installer to create a registry item which 
specified the location of the most recent Cygwin installation. This would 
allow those GUI applications which are _not_ typically invoked from a 
Cygwin shell prompt to locate Cygwin tools. It would also allow Cygwin 
application installers to create desktop shortcuts which specify the Cygwin 
/bin directory as the application working directory such that cygwin1.dll 
can be located when the application is invoked. Is there any reason why the 
generation of such an a 'Cygwin installation path' registry entry should 
not be added to the Cygwin net installer?

John Dallaway


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Determining the location of a Cygwin installation

2003-03-26 Thread Marcel Telka
On Wed, Mar 26, 2003 at 03:44:29PM -0500, Igor Pechtchanski wrote:
 On Wed, 26 Mar 2003, Marcel Telka wrote:
 
  On Wed, Mar 26, [EMAIL PROTECTED]:35:47PM -0500, Igor Pechtchanski wrote:
   P.S. Maybe we could factor out the code that detects a Cygwin installation
   from setup into a library, and distribute a small cygdetect.exe that links
   with it?
 
  ... and cygdetect.exe will be placed in /bin :-)
 
 That wouldn't matter.  Like cygcheck.exe and setup.exe, it'll be a MinGW

Download like cygcheck.exe ?
So, then simply download cygcheck.exe and run it with appropriate parameters...

 application, independent of cygwin1.dll.  You'd be able to download it
 from the web (preferably from cygwin.com), and running it would output the
 Windows path to /bin.

-- 
+---+
| Marcel Telka   e-mail:   [EMAIL PROTECTED]  |
|homepage: http://telka.sk/ |
|jabber:   [EMAIL PROTECTED] |
+---+

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Determining the location of a Cygwin installation

2003-03-26 Thread Igor Pechtchanski
On Wed, 26 Mar 2003, Marcel Telka wrote:

 On Wed, Mar 26, 2003 at 03:44:29PM -0500, Igor Pechtchanski wrote:
  On Wed, 26 Mar 2003, Marcel Telka wrote:
 
   On Wed, Mar 26, 2003 at 03:35:47PM -0500, Igor Pechtchanski wrote:
P.S. Maybe we could factor out the code that detects a Cygwin installation
from setup into a library, and distribute a small cygdetect.exe that links
with it?
  
   ... and cygdetect.exe will be placed in /bin :-)
 
  That wouldn't matter.  Like cygcheck.exe and setup.exe, it'll be a MinGW

 Download like cygcheck.exe ?
 So, then simply download cygcheck.exe and run it with appropriate parameters...

  application, independent of cygwin1.dll.  You'd be able to download it
  from the web (preferably from cygwin.com), and running it would output the
  Windows path to /bin.

D'oh!  Now why didn't I think of that?^{TM}  :-D
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Determining the location of a Cygwin installation

2003-03-26 Thread Andrew DeFaria
Tino Lange wrote:

This is not true! There's a trick: At least under = Windows 2000 you 
can just put 'cygpath.exe' (and its path) in your so called 
ApplicationPaths. This is a Registry location for several utils you 
can just call by name - no more needed. Have a look at your:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App 
Paths When you start such an application it don't need to be in the 
path of the machine.

Solution:
Just put 'cygpath.exe' in your Application path - then you're able to 
use it from everywhere on your machine. So you can find the CYGWIN 
root with cygpath -w /.
While interesting there are two flaws here. Firstly, this down't work on 
all versions of Windows. Secondly, if I could get my users to set their 
ApplicationPaths I could as easily get them to set their PATHs. The 
real world situation is that this is not the case and neither PATH nore 
ApplicationPaths are set.



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: Determining the location of a Cygwin installation

2003-03-26 Thread Robert Collins
On Thu, 2003-03-27 at 07:51, Andrew DeFaria wrote:
 Marcel Telka wrote:

 
 (Of course, going hand in hand with this would be a command line driven 
 setup.exe but perhaps we shouldn't go there just yet...)

Uhh, grab the source. It's ~ 95% there.

Rob
-- 
GPG key available at: http://users.bigpond.net.au/robertc/keys.txt.


signature.asc
Description: This is a digitally signed message part


Re: Determining the location of a Cygwin installation

2003-03-26 Thread Elfyn McBratney
 Tino Lange wrote:

  This is not true! There's a trick: At least under = Windows 2000 you
  can just put 'cygpath.exe' (and its path) in your so called
  ApplicationPaths. This is a Registry location for several utils you
  can just call by name - no more needed. Have a look at your:
  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App
  Paths When you start such an application it don't need to be in the
  path of the machine.
 
  Solution:
  Just put 'cygpath.exe' in your Application path - then you're able to
  use it from everywhere on your machine. So you can find the CYGWIN
  root with cygpath -w /.

 While interesting there are two flaws here. Firstly, this down't work on
 all versions of Windows. Secondly, if I could get my users to set their
 ApplicationPaths I could as easily get them to set their PATHs. The
 real world situation is that this is not the case and neither PATH nore
 ApplicationPaths are set.

So how about using something like regtool, there are quite a few native
(non-Cygwin dependant) regtool alikes around. From there all you need to do
is check HKLM or HKCU. Or write your own custom implementation.


Regards,

Elfyn McBratney
[EMAIL PROTECTED]
www.exposure.org.uk



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Determining the location of a Cygwin installation

2003-03-26 Thread Elfyn McBratney
 Andrew DeFaria wrote:

  Secondly, if I could get my users to set their
  ApplicationPaths I could as easily get them to set their PATHs. The
real world
  situation is that this is not the case and neither PATH nore
ApplicationPaths
  are set.

 Here's an idea: Traverse the directory %SystemDrive%\Documents and
 Settings\\Start Menu\Programs (where  is All Users and also
 the user's username) looking for a directory named Cygwin.  In that
 directory there are shortcuts that contain the path to various
 subdirectories of the Cygwin install directory.  The strings in the
 shortcut files may be Unicode, but the info is there.

Not always...

 Cygwin's setup.exe always creates a Start Menu entry, right?  So those
 shortcuts should always be easy to find.  If a user has deleted his
 Start Menu entries for Cygwin, fall back to a full disk search for
 cygwin1.dll.

...The user may have chose not to Create start menu items in setup.exe .
There's also the fact that these machines may not be NT based, and didn't
Documents and Settings only get introduced in Windows 2000? Haven't used
NT 4 for years.


Regards,

Elfyn McBratney
[EMAIL PROTECTED]
www.exposure.org.uk



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Determining the location of a Cygwin installation

2003-03-26 Thread Andrew DeFaria
Elfyn McBratney wrote:

While interesting there are two flaws here. Firstly, this down't work 
on all versions of Windows. Secondly, if I could get my users to set 
their ApplicationPaths I could as easily get them to set their 
PATHs. The real world situation is that this is not the case and 
neither PATH nore ApplicationPaths are set.
So how about using something like regtool, there are quite a few 
native (non-Cygwin dependant) regtool alikes around. From there all 
you need to do is check HKLM or HKCU. Or write your own custom 
implementation.
What exactly am I checking for? That ApplicationPaths is set properly or 
that PATH has a Cygwin bin dir? And what if they don't. In that case I'm 
back to the same situation in trying to determine where Cygwin was 
installed.

Or am I checking to see where Cygwin is installed by looking, as the 
original poster had queried, where Cygwin's bin is mounted? How does 
that fit with Christopher's assertion that that might go away? Again, I 
would think it would be far more meaningful to dedicate at least one 
registry spot to denote where Cygwin was installed and then build from 
there. Seems to be a very logical way to do it from my point of view but 
as always, this is just my opinion.



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: Determining the location of a Cygwin installation

2003-03-26 Thread Elfyn McBratney
 Elfyn McBratney wrote:

  While interesting there are two flaws here. Firstly, this down't work
  on all versions of Windows. Secondly, if I could get my users to set
  their ApplicationPaths I could as easily get them to set their
  PATHs. The real world situation is that this is not the case and
  neither PATH nore ApplicationPaths are set.
 
  So how about using something like regtool, there are quite a few
  native (non-Cygwin dependant) regtool alikes around. From there all
  you need to do is check HKLM or HKCU. Or write your own custom
  implementation.

 What exactly am I checking for? That ApplicationPaths is set properly or
 that PATH has a Cygwin bin dir? And what if they don't. In that case I'm
 back to the same situation in trying to determine where Cygwin was
 installed.

 Or am I checking to see where Cygwin is installed by looking, as the
 original poster had queried, where Cygwin's bin is mounted? How does
 that fit with Christopher's assertion that that might go away? Again, I
 would think it would be far more meaningful to dedicate at least one
 registry spot to denote where Cygwin was installed and then build from
 there. Seems to be a very logical way to do it from my point of view but
 as always, this is just my opinion.

Sorry, I wasn't too clear. :-) The latter is what I meant, and if Cygwin
stops storing it's mount table in the registry setup.exe would have to know
how to access/change it so maybe (I think you suggested it) a command line
option would be best. This could show either a full or partial view of the
mount table.


Regards,

Elfyn McBratney
[EMAIL PROTECTED]
www.exposure.org.uk



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Determining the location of a Cygwin installation

2003-03-26 Thread Rolf Campbell
Andrew DeFaria wrote:
Elfyn McBratney wrote:

But as cgf (the Really Cool Manager) said the registry keys are not to 
be relied on as they might not be there forever. 


Yeah but what I'm saying is that there should be a commitment to at 
least one registry entry which denotes the [active] installation path of 
Cygwin. IOW I was sort of requesting it. Again, it's only my opinion. 
But to me it seems logical that you gotta know where to start... and the 
registry is there, partially for such a purpose
What do you mean by [active]?  It is possible to have multiple cygwins 
installed.  The easiest way would be to have 2 different users install 
local for Just Me.

And about searching for bin/cygwin1.dll.  You could first try 
C:\cygwin\bin\ (which should match 99% of all cases), and only if that 
fails, look for the DLL the hard way.

-Rolf



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: Determining the location of a Cygwin installation

2003-03-26 Thread Rolf Campbell
Francis Litterio wrote:
Andrew DeFaria wrote:


Secondly, if I could get my users to set their
ApplicationPaths I could as easily get them to set their PATHs. The real world
situation is that this is not the case and neither PATH nore ApplicationPaths
are set.


Here's an idea: Traverse the directory %SystemDrive%\Documents and
Settings\\Start Menu\Programs (where  is All Users and also
the user's username) looking for a directory named Cygwin.  In that
directory there are shortcuts that contain the path to various
subdirectories of the Cygwin install directory.  The strings in the
shortcut files may be Unicode, but the info is there.
Cygwin's setup.exe always creates a Start Menu entry, right?
Only if you don't unclick the option...
 So those
shortcuts should always be easy to find.  If a user has deleted his
Start Menu entries for Cygwin, fall back to a full disk search for
cygwin1.dll.
--
Francis Litterio
[EMAIL PROTECTED]
http://world.std.com/~franl/
GPG and PGP public keys available on keyservers.


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/