This is the mail archive of the cygwin 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: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?)


On Tue, 10 Feb 2009, Larry Hall (Cygwin) wrote:
Tim McDaniel wrote:
I have several "trampoline" scripts, a bat file
doing nothing but invoking a corresponding bash shell script or Perl
program.  I have to hard-code a location for the bash / perl
interpreter, but those locations change from user to user (some people
install under c:\, some under the standard location).  I would like to
have the scripts work for any system.

This can be done now,

That appears to contradict what you wrote yesterday:


] If you need to do this generically for any batch file, then yes, you
] have to rely on external data and heuristics.  Going to the registry
] to see if it will help or searching the file system are two
] alternatives but there is no one key or one spot that will
] unequivocally give you the installation path.  Looking at the mount
] paths in the registry will work for 1.5 but is flawed for 1.7.
] Looking in the file-system may work depending on what you look for
] and where you start looking.

You did mention

] HKLM/Software/Cygwin/setup, the "rootdir" value.

But you noted that that is in version 1.7.

(When mentioning it, by the way, you might also mention REG.exe, a
program to do registry access, and the options for FOR that allow
running a program and getting the results in a variable in CMD.exe.
I hadn't heard of REG until I went searching just now.)

--
Tim McDaniel, tmcd@panix.com

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


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