Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?)
On Tue, 10 Feb 2009 15:47:10 -0500 Larry Hall (Cygwin) reply-to-list-only...@cygwin.com wrote: rhubbell wrote: Are you and Linda married by any chance? Now that's funny! :-) I'm glad you laughed, whew! That exchange had me a little worried about the list. But now I see all's fine. In case I need to be crystal clear on this subject, no we have no common relationship beyond that of both being participants on this list. -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 893-9889 - FAX Holliston, MA 01746 _ A: Yes. Q: Are you sure? A: Because it reverses the logical flow of conversation. Q: Why is top posting annoying in email? -- 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/ -- 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: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?)
rhubbell wrote: On Tue, 10 Feb 2009 15:47:10 -0500 Larry Hall (Cygwin) wrote: http://cygwin.com/acronyms/#PCYMTNQREAIYR. Thanks. rhubbell wrote: Are you and Linda married by any chance? Now that's funny! :-) I'm glad you laughed, whew! That exchange had me a little worried about the list. But now I see all's fine. Indeed. I know Linda and she knows me from this list. We've both been around here a while. So there may be some shorthand and references that the uninitiated may have missed. But if our exchange made you uncomfortable, your constitution may be too weak for this list. If you doubt me, put on your favorite pair of flame-proof overalls and do some light reading of the email archives. :-) -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 893-9889 - FAX Holliston, MA 01746 _ A: Yes. Q: Are you sure? A: Because it reverses the logical flow of conversation. Q: Why is top posting annoying in email? -- 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: How does one find where Cygwin was installed from Windows?
It's not like in Windows where you can add something to the linux-registry, /etc, or path-specific part /etc/profile.d and have other apps pick up this information. It would make more sense to put it in a registry environment variable. What do you think? 'setx.exe' a CLI utility on Vista and XP system (2000?), allows you to set an evironment variable, say, CYGWIN_ROOT, and/or CYGWIN_BIN, that percolates up to the System or User Enviroment variable space. It comes with Windows. Wouldn't this make more sense than messing with the registry directly. 'setx' can be run from a Cygwin shell. I've tried it. It works (Vista Home Premium 64b with Cygwin 1.5). -- 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/
RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?)
Larry Hall (Cygwin) wrote: What do you think? Actually, this has been discussed already and has been resolved by having 1.7's 'setup.exe' putting the Cygwin root installation directory in... the registry! See HKLM/Software/Cygwin/setup, the rootdir value. I know, it's not in the environment. That might be nicer. But such a change could spoil my there's no good way statement so I can't endorse it. ;-) --- Plblblblb! (*raz*) Um...so..um... I know it could spoil your day and all...but it really would be more *linux* like if it was added to the environment variables. But the environment variables, in windows, get their initial values from the registry! So ...well, you could still complain that since they start from the windows reg, they are contaminated?... I know it wouldn't be ideal for perverse reasons, but maybe in 1.7 (or even the next maint release -- since whoever owns the cygwin-package that owns startxwin.bat may want to fix their package's startup .bat file, sooner rather than later), a CYGWINDIR string value could be added under : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment (assuming installed at machine level and not in a per user). I forget, does Cygwin offer the option of installing for 1 user vs. all users? I only remember it being installed for all...? Besides your distaste for something that could make it more difficult to complain, might that be a more generic solution? Then anything else in Cygwin that uses paths -- including setup's cygwin.bat could use %CygWinDir% -- even registry string values could be change to expandable string values (REG_SZ - REG_EXPAND_SZ) that could use %CygWinDir% in their expansions -- so even fewer places would have to have the Cygwin-install location expanded as text in the registry (or any other batch files). Whatcha think? I'm sure I'll post something before too long that you can complain about again...I can almost guarantee that! ;^ -- 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: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?)
On 02/10/2009, Linda Walsh wrote: Plblblblb! (*raz*) Um...so..um... I know it could spoil your day and all...but it really would be more *linux* like if it was added to the environment variables. OK, I need to be clear. I have nothing against the enviroment variable idea. I was making (a little) joke. If you'd like to see this happen, I'd suggest offering it as a patch to 'setup.exe'. Since I'm not the gatekeeper for 'setup.exe' code, whether or not I'm convinced it's a good idea isn't necessarily going to help or hurt your cause. The patch is likely to be the path of least (though not necessarily 'no') resistence. I forget, does Cygwin offer the option of installing for 1 user vs. all users? I only remember it being installed for all...? Both are offered in 1.7. -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 893-9889 - FAX Holliston, MA 01746 _ A: Yes. Q: Are you sure? A: Because it reverses the logical flow of conversation. Q: Why is top posting annoying in email? -- 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: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?)
Are you and Linda married by any chance? On Tue, 10 Feb 2009 15:36:49 -0500 Larry Hall (Cygwin) reply-to-list-only...@cygwin.com wrote: On 02/10/2009, Linda Walsh wrote: Plblblblb! (*raz*) Um...so..um... I know it could spoil your day and all...but it really would be more *linux* like if it was added to the environment variables. OK, I need to be clear. I have nothing against the enviroment variable idea. I was making (a little) joke. If you'd like to see this happen, I'd suggest offering it as a patch to 'setup.exe'. Since I'm not the gatekeeper for 'setup.exe' code, whether or not I'm convinced it's a good idea isn't necessarily going to help or hurt your cause. The patch is likely to be the path of least (though not necessarily 'no') resistence. I forget, does Cygwin offer the option of installing for 1 user vs. all users? I only remember it being installed for all...? Both are offered in 1.7. -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 893-9889 - FAX Holliston, MA 01746 _ A: Yes. Q: Are you sure? A: Because it reverses the logical flow of conversation. Q: Why is top posting annoying in email? -- 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/ -- 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: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?)
rhubbell wrote: Are you and Linda married by any chance? Now that's funny! :-) In case I need to be crystal clear on this subject, no we have no common relationship beyond that of both being participants on this list. -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 893-9889 - FAX Holliston, MA 01746 _ A: Yes. Q: Are you sure? A: Because it reverses the logical flow of conversation. Q: Why is top posting annoying in email? -- 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: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?)
On Tue, 10 Feb 2009, Linda Walsh cyg...@tlinx.org wrote: Then anything else in Cygwin that uses paths -- including setup's cygwin.bat could use %CygWinDir% Not that there's being a vote taken or anything, but I would like to support that notion. 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. -- Tim McDaniel, t...@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/
Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?)
Tim McDaniel wrote: On Tue, 10 Feb 2009, Linda Walsh cygwin AT tlinx DOT org wrote: http://cygwin.com/acronyms/#PCYMTNQREAIYR. Thanks. Then anything else in Cygwin that uses paths -- including setup's cygwin.bat could use %CygWinDir% Not that there's being a vote taken or anything, but I would like to support that notion. 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, if you look back through the thread to all the different options I outlined and even a few scripts others have thrown in. What Linda is proposing here is simply having the mechanism for communicating this be an environment variable. While this could arguably make it easier to do what you want, it doesn't mean that you can't do it now for either Cygwin 1.5 or the upcoming 1.7 (though you may be required to do something different for 1.5 and 1.7.) -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 893-9889 - FAX Holliston, MA 01746 _ A: Yes. Q: Are you sure? A: Because it reverses the logical flow of conversation. Q: Why is top posting annoying in email? -- 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: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?)
Larry Hall (Cygwin) wrote: This can be done now, if you look back through the thread to all the different options I outlined and even a few scripts others have thrown in. What Linda is proposing here is simply having the mechanism for communicating this be an environment variable. While this could arguably make it easier to do what you want, it doesn't mean that you can't do it now for either Cygwin 1.5 or the upcoming 1.7 (though you may be required to do something different for 1.5 and 1.7.) For what it's worth, you can easily retrieve a known registry key (that you have permission to access) using a batch file and then store that in a temporary variable. (I'm sure the gurus already know this) I really dislike software that pollutes my environment for me, but I really like software that lets me do it myself, if that makes any sense. Ralph -- 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: 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, t...@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/
Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?)
Tim McDaniel wrote: 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: Not really. See below. ] 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. This would work for 1.5 as well if someone back-ported the 1.7 change. But unless someone makes some change to both the 'setup.exe' for 1.5 and the one for 1.7, you still won't have one place to look for this information. And even if this happens, it would only work for installations that have used the new 'setup.exe'. That may cover all 1.7 installations but it will be unreliable for 1.5 for... probably forever (or long enough that it will seem that way.) That doesn't mean that one can't create something that works good enough for one's needs. It just means that there's no good way(tm) to do this for all cases. If that's not a concern to you, then you diligently read this thread for its key points for nothing. ;-) If you're wondering where in the registry to find this information for 1.5 (assuming you're stuck with no other option), this FAQ should help point you in the right direction: http://cygwin.com/faq/faq-nochunks.html#faq.setup.uninstall-all (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.) Sounds similar to Cygwin's 'regtool'. Definitely would be helpful if you're trying to batch script something like this. -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 893-9889 - FAX Holliston, MA 01746 _ A: Yes. Q: Are you sure? A: Because it reverses the logical flow of conversation. Q: Why is top posting annoying in email? -- 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: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?)
On Tue, 10 Feb 2009, Larry Hall 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. ... (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.) Sounds similar to Cygwin's 'regtool'. Definitely would be helpful if you're trying to batch script something like this. Well, not in *this* special case, because like this is trying to find the Cygwin installation in the first place; if it knew where regtool was, it would already know where Cygwin was installed ... But thanks for the pointer to regtool -- I'll make a note of it for other uses. -- Tim McDaniel, t...@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/
Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?)
Tim McDaniel wrote: On Tue, 10 Feb 2009, Larry Hall wrote: snip Sounds similar to Cygwin's 'regtool'. Definitely would be helpful if you're trying to batch script something like this. Well, not in *this* special case, because like this is trying to find the Cygwin installation in the first place; if it knew where regtool was, it would already know where Cygwin was installed ... Yeah, that's what I meant though it could be read either way... -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 893-9889 - FAX Holliston, MA 01746 _ A: Yes. Q: Are you sure? A: Because it reverses the logical flow of conversation. Q: Why is top posting annoying in email? -- 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: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?)
On Tue, Feb 10, 2009 at 06:22:21PM -0600, Tim McDaniel wrote: Well, not in *this* special case, because like this is trying to find the Cygwin installation in the first place; if it knew where regtool was, it would already know where Cygwin was installed ... You sort of have to know where reg or any other program is located if you want to run it too. If this is really a terrifically big issue then just add the cygwin bin directory to your windows path directory and regtool, mount, and all sorts of other programs will be available to you. cgf -- 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: How does one find where Cygwin was installed from Windows?
Larry Hall (Cygwin) wrote: Linda, you've been around this list long enough to understand how to handle them. Please, if you want to berate someone for answering your posts, do it on one list only. --- That wasn't my intent in my original response. I originally only wanted to report a problem in a cygwin-app and off the cuff, I suggested a possible solution. My bad. But it raised the question -- if my solution didn't work, then what was a good solution. So I asked how a generic Windows .bat program could find out where Cygwin was installed -- with a lead-in of asking of how it was done in the mount -p program. You told me that was not necessary for me to know -- but it still didn't answer the 2nd half -- which was how a general Windows.bat file might find the location of Cygwin so it could even call mount -p in the first place. Please note. The .bat file in question ISN'T my .bat file. I made a suggestion that was incorrect. So I wanted to know how someone writing .bat file, in the general case, *should* be doing it --- the conversation wasn't designed to be berating. It was just growing frustrating because the preferred answer seemed to be circular. I.e. 'mount' will always be in /bin -- which implies knowing where bin is Turns out the answer is that there is no good solution. This could then be a lead-in to a next suggestion -- that just like on linux on QT -- or on Windows with various utils, they put something in the environment so other programs can locate where the package was installed. I.e. maybe Cygwin should add an official dir in the system (for an all-user install), or user (for a 1-user install) environment (stored in the registry), so add-on applications that rely on Cygwin or rely on knowing where it was installed will work. It's not like in Windows where you can add something to the linux-registry, /etc, or path-specific part /etc/profile.d and have other apps pick up this information. It would make more sense to put it in a registry environment variable. What do you think? -- 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: How does one find where Cygwin was installed from Windows?
On 02/09/2009, Linda Walsh wrote: I.e. maybe Cygwin should add an official dir in the system (for an all-user install), or user (for a 1-user install) environment (stored in the registry), so add-on applications that rely on Cygwin or rely on knowing where it was installed will work. It's not like in Windows where you can add something to the linux-registry, /etc, or path-specific part /etc/profile.d and have other apps pick up this information. It would make more sense to put it in a registry environment variable. What do you think? Actually, this has been discussed already and has been resolved by having 1.7's 'setup.exe' putting the Cygwin root installation directory in... the registry! See HKLM/Software/Cygwin/setup, the rootdir value. I know, it's not in the environment. That might be nicer. But such a change could spoil my there's no good way statement so I can't endorse it. ;-) -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 893-9889 - FAX Holliston, MA 01746 _ A: Yes. Q: Are you sure? A: Because it reverses the logical flow of conversation. Q: Why is top posting annoying in email? -- 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/