* How does one find "cygdrive path" in a Win ".bat" file (was Re: Bug in "startXwin.bat") [not found] ` <4990B128.7030004@cygwin.com> @ 2009-02-10 0:34 ` Linda Walsh 2009-02-10 0:57 ` Larry Hall (Cygwin) 2009-02-10 9:02 ` How does one find "cygdrive path" in a Win ".bat" file (was Re: Bug in "startXwin.bat") Thorsten Kampe 0 siblings, 2 replies; 26+ messages in thread From: Linda Walsh @ 2009-02-10 0:34 UTC (permalink / raw) To: cygwin Larry Hall (Cygwin X) wrote: > Linda Walsh wrote: >> The startxwin.sh script works, but startxwin.bat does not work if >> your Cygwin installation isn't in the default location. >> >> You could use "mount -p" (presuming your cygwin\bin is in your windows >> path, as mine is). >> >> If not, need to look in the registry: >> "\HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts >> v2\cygdrive prefix" > > No, you don't need to look in the registry. There's nothing there that > 'mount' won't tell you. Forget about the registry. You'll be better > off, especially when Cygwin 1.7 is released. --- I'm curious -- how does mount find or 'know' the cygdrive path if it doesn't come from the registry. For that matter, how would a windows .bat file find the 'mount.exe' binary if the .bat file doesn't know 'cygdrive path'? -- 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How does one find "cygdrive path" in a Win ".bat" file (was Re: Bug in "startXwin.bat") 2009-02-10 0:34 ` How does one find "cygdrive path" in a Win ".bat" file (was Re: Bug in "startXwin.bat") Linda Walsh @ 2009-02-10 0:57 ` Larry Hall (Cygwin) 2009-02-10 1:30 ` Ralph Hempel 2009-02-10 1:37 ` How does one find "cygdrive path" in a Win ".bat" file Linda Walsh 2009-02-10 9:02 ` How does one find "cygdrive path" in a Win ".bat" file (was Re: Bug in "startXwin.bat") Thorsten Kampe 1 sibling, 2 replies; 26+ messages in thread From: Larry Hall (Cygwin) @ 2009-02-10 0:57 UTC (permalink / raw) To: cygwin Linda Walsh wrote: > Larry Hall (Cygwin X) wrote: >> Linda Walsh wrote: >>> The startxwin.sh script works, but startxwin.bat does not work if >>> your Cygwin installation isn't in the default location. >>> >>> You could use "mount -p" (presuming your cygwin\bin is in your >>> windows path, as mine is). >>> >>> If not, need to look in the registry: >>> "\HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts >>> v2\cygdrive prefix" >> >> No, you don't need to look in the registry. There's nothing there that >> 'mount' won't tell you. Forget about the registry. You'll be better >> off, especially when Cygwin 1.7 is released. > --- > I'm curious -- how does mount find or 'know' the cygdrive path > if it doesn't come from the registry. How it finds it is an implementation detail. There's no need to know how it does what it does if it does what you want. ;-) And, like I said, the registry won't be used for 1.7 so anyone that uses this as a basis of anything will find it "broken" once 1.7 is released. > For that matter, how would a windows .bat file find the > 'mount.exe' binary if the .bat file doesn't know 'cygdrive path'? That's a different issue. However you imply a paradox that doesn't exist. Whether one knows the 'cygdrive path' or not will not make it easier to find 'mount.exe'. 'mount.exe' is always in '/bin'. As for the issue of finding '/bin', there may be times when it is necessary to script this, though I would say this is not one of those cases. For those cases, searching the file-system or spelunking in the registry are possible avenues, each with their own pluses and minuses. In this case, just looking at 'cygwin.bat' will provide the answer needed. -- 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How does one find "cygdrive path" in a Win ".bat" file (was Re: Bug in "startXwin.bat") 2009-02-10 0:57 ` Larry Hall (Cygwin) @ 2009-02-10 1:30 ` Ralph Hempel 2009-02-10 1:37 ` How does one find "cygdrive path" in a Win ".bat" file Linda Walsh 1 sibling, 0 replies; 26+ messages in thread From: Ralph Hempel @ 2009-02-10 1:30 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 449 bytes --] Here's how I do it in a little batch file that I put on my USB pen drive: It's in the attached .TXT file - you'll need to rename it to .BAT Note that this batch file will OVERWRITE your fstab so please review it before installing and using it on your system. Basically, it lets me carry Cygwin on a USB stick and it does not care what drive letter it's attached as. Note also that USB sticks are slowwww, so it's just for emergencies :-) Ralph [-- Attachment #2: usbCygwin.txt --] [-- Type: text/plain, Size: 1344 bytes --] @ECHO OFF REM -------------------------------------------------------------------------- REM Batch file to start Cygwin on arbitrary drive letters SETLOCAL FOR /F %%D IN ("%CD%") DO SET CYGDRIVE=%%~dD REM -- Check if we've already modified the fstab for this drive letter IF "%CYGDRIVE%"=="%CYGWIN_DRIVE%" GOTO :DONE REM -- Check if the original fstab has been backed up IF EXIST %CYGDRIVE%\cygwinTest\etc\fstab.original GOTO MAKEFSTAB copy %CYGDRIVE%\cygwinTest\etc\fstab %CYGDRIVE%\cygwinTest\etc\fstab.original REM -- Set up the default fstab :MAKEFSTAB echo # Custom fstab for removable media > %CYGDRIVE%\cygwinTest\etc\fstab echo # See /cygwin/etc/fstab.original for defaults >> %CYGDRIVE%\cygwinTest\etc\fstab echo %CYGDRIVE%/cygwinTest / ntfs binary 0 0 >> %CYGDRIVE%\cygwinTest\etc\fstab echo %CYGDRIVE%/cygwinTest/bin /usr/bin ntfs binary 0 0 >> %CYGDRIVE%\cygwinTest\etc\fstab echo %CYGDRIVE%/cygwinTest/lib /usr/lib ntfs binary 0 0 >> %CYGDRIVE%\cygwinTest\etc\fstab rem -- Start up thedefault shell chdir %CYGDRIVE%\cygwinTest\bin bash --login -i ENDLOCAL :DONE REM We're done with the local variables, but remember to set REM a variable that tells us the drive Cygwin is running on SET CYGWIN_DRIVE=%CYGDRIVE% EXIT /B 0 [-- Attachment #3: Type: text/plain, Size: 218 bytes --] -- 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How does one find "cygdrive path" in a Win ".bat" file 2009-02-10 0:57 ` Larry Hall (Cygwin) 2009-02-10 1:30 ` Ralph Hempel @ 2009-02-10 1:37 ` Linda Walsh 2009-02-10 2:07 ` Larry Hall (Cygwin) 1 sibling, 1 reply; 26+ messages in thread From: Linda Walsh @ 2009-02-10 1:37 UTC (permalink / raw) To: cygwin Larry Hall (Cygwin) wrote: > Linda Walsh wrote: >> Larry Hall (Cygwin X) wrote: >>> Linda Walsh wrote: >>>> The startxwin.sh script works, but startxwin.bat does not work if >>>> your Cygwin installation isn't in the default location. >>>> >>>> You could use "mount -p" (presuming your cygwin\bin is in your >>>> windows path, as mine is). >>>> >>>> If not, need to look in the registry: >>>> "\HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts >>>> v2\cygdrive prefix" >>> >>> No, you don't need to look in the registry. There's nothing there that >>> 'mount' won't tell you. Forget about the registry. You'll be better >>> off, especially when Cygwin 1.7 is released. >> --- >> I'm curious -- how does mount find or 'know' the cygdrive path >> if it doesn't come from the registry. > > How it finds it is an implementation detail. There's no need to know > how it does what it does if it does what you want. ;-) And, like I said, > the registry won't be used for 1.7 so anyone that uses this as a basis > of anything will find it "broken" once 1.7 is released. > >> For that matter, how would a windows .bat file find the >> 'mount.exe' binary if the .bat file doesn't know 'cygdrive path'? > > That's a different issue. --- Then answer the question. First you avoid the answer by saying it is an implementation detail. Then you say I'm implying a paradox that doesn't exist. I didn't write the windows .BAT file "startXWin.bat". If it is so easy to do, then why did you point me at a broken solution in my earlier post? You (Larry Hall (Cygwin)) wrote: >> ... BUT allow no keyboard input. > > Did you miss this FAQ? > > <http://x.cygwin.com/docs/faq/cygwin-x-faq.html#q-i-cant-type-anything> The FAQ first answer is: "Launch the X server via the shortcut under "Cygwin-X" on the start menu." ---- Trouble is -- that script is broken. Why is it broken? It's not an X problem. It's a more general problem of how does a ".bat" script in Windows find what the "Cygdrive prefix" is, so it can call "/bin/mount" to find the "Cygdrive prefix" it was looking for in the first place? > However you imply a paradox that doesn't exist. --- Looks paradoxical to me. > Whether one knows the 'cygdrive path' or not will not make it > easier to find 'mount.exe'. 'mount.exe' is always in '/bin'. --- '/bin' is not a valid windows path. You can't use that as a path in a .BAT file and expect it to resolve correctly. > As for > the issue of finding '/bin', there may be times when it is necessary > to script this, though I would say this is not one of those cases. ---- I don't understand. Why not? You told me to start a Cygwin program from the startmenu shortcut that was provided for it. The shortcut points to a windows .bat file that has \cygwin hard-coded in it. It doesn't find the correct path. > For those cases, searching the file-system or spelunking in the > registry are possible avenues, each with their own pluses and minuses. > In this case, just looking at 'cygwin.bat' will provide the answer > needed. --- It certainly doesn't on my machine. Maybe it's changed and I don't have an update, but my cygwin.bat file says: ------------------- @echo off C: chdir C:\\bin bash --login -i ------------------- Because cygwin.bat was installed by cygwin's setup.exe, setup can fill in the value for "cygwin prefix" -- but nothing in the above script tells me how a normal windows ".bat" file, independent of setup.exe, would get that information. -- 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How does one find "cygdrive path" in a Win ".bat" file 2009-02-10 1:37 ` How does one find "cygdrive path" in a Win ".bat" file Linda Walsh @ 2009-02-10 2:07 ` Larry Hall (Cygwin) 2009-02-10 2:55 ` How does one find where Cygwin was installed from Windows? Linda Walsh 0 siblings, 1 reply; 26+ messages in thread From: Larry Hall (Cygwin) @ 2009-02-10 2:07 UTC (permalink / raw) To: cygwin Linda Walsh wrote: > Larry Hall (Cygwin) wrote: >> Linda Walsh wrote: >>> Larry Hall (Cygwin X) wrote: >>>> Linda Walsh wrote: >>>>> The startxwin.sh script works, but startxwin.bat does not work if >>>>> your Cygwin installation isn't in the default location. >>>>> >>>>> You could use "mount -p" (presuming your cygwin\bin is in your >>>>> windows path, as mine is). >>>>> >>>>> If not, need to look in the registry: >>>>> "\HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts >>>>> v2\cygdrive prefix" >>>> >>>> No, you don't need to look in the registry. There's nothing there that >>>> 'mount' won't tell you. Forget about the registry. You'll be better >>>> off, especially when Cygwin 1.7 is released. >>> --- >>> I'm curious -- how does mount find or 'know' the cygdrive path >>> if it doesn't come from the registry. >> >> How it finds it is an implementation detail. There's no need to know >> how it does what it does if it does what you want. ;-) And, like I said, >> the registry won't be used for 1.7 so anyone that uses this as a basis >> of anything will find it "broken" once 1.7 is released. >> >>> For that matter, how would a windows .bat file find the >>> 'mount.exe' binary if the .bat file doesn't know 'cygdrive path'? >> >> That's a different issue. > --- > Then answer the question. First you avoid the answer by saying > it is an implementation detail. <long winded response deleted> 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. Of course, I'm having trouble seeing the benefit of continuing with either thread, given your stubbornness to hold onto the notion that there must be a complicated way to solve this problem. So let me summarize once more. You can take it as your answer or not. 1. Going to the registry in general for information you can get from the Cygwin 'mount' command is not supported and is error prone. 2. Providing the proper path in 'startxwin.bat' does not require special analysis of the registry, file system, or any other source to find the proper root for Cygwin. There are at least two ways of directly solving this robustly: a. Have 'setup.exe' do it, like it does for 'cygwin.bat' b. Use the path to 'startxwin.bat' as the path (it is in the Cygwin installation path after all). 3. 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. Hopefully this summary of what I've said already is clear and compact enough for you to understand what I'm saying. If not, I'll leave you to enjoy your continued quest unimpeded by more answers from me. If you don't like this answer, please feel free to post more long-winded prose that picks each word of my response apart such that it looses all context. But I think it's fair to say that the thread will end after that. There's really nothing worthwhile that can be said relative to your inquiry that hasn't already been covered. -- 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How does one find where Cygwin was installed from Windows? 2009-02-10 2:07 ` Larry Hall (Cygwin) @ 2009-02-10 2:55 ` Linda Walsh 2009-02-10 4:22 ` Larry Hall (Cygwin) 2009-02-13 23:09 ` How does one find where Cygwin was installed from Windows? Lee D.Rothstein 0 siblings, 2 replies; 26+ messages in thread From: Linda Walsh @ 2009-02-10 2:55 UTC (permalink / raw) To: cygwin 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How does one find where Cygwin was installed from Windows? 2009-02-10 2:55 ` How does one find where Cygwin was installed from Windows? Linda Walsh @ 2009-02-10 4:22 ` Larry Hall (Cygwin) 2009-02-10 20:21 ` RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) Linda Walsh 2009-02-13 23:09 ` How does one find where Cygwin was installed from Windows? Lee D.Rothstein 1 sibling, 1 reply; 26+ messages in thread From: Larry Hall (Cygwin) @ 2009-02-10 4:22 UTC (permalink / raw) To: cygwin 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) 2009-02-10 4:22 ` Larry Hall (Cygwin) @ 2009-02-10 20:21 ` Linda Walsh 2009-02-10 20:39 ` Larry Hall (Cygwin) 2009-02-10 20:56 ` Tim McDaniel 0 siblings, 2 replies; 26+ messages in thread From: Linda Walsh @ 2009-02-10 20:21 UTC (permalink / raw) To: cygwin 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) 2009-02-10 20:21 ` RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) Linda Walsh @ 2009-02-10 20:39 ` Larry Hall (Cygwin) 2009-02-10 20:45 ` rhubbell 2009-02-10 20:56 ` Tim McDaniel 1 sibling, 1 reply; 26+ messages in thread From: Larry Hall (Cygwin) @ 2009-02-10 20:39 UTC (permalink / raw) To: cygwin 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) 2009-02-10 20:39 ` Larry Hall (Cygwin) @ 2009-02-10 20:45 ` rhubbell 2009-02-10 20:49 ` Larry Hall (Cygwin) 0 siblings, 1 reply; 26+ messages in thread From: rhubbell @ 2009-02-10 20:45 UTC (permalink / raw) To: cygwin Are you and Linda married by any chance? On Tue, 10 Feb 2009 15:36:49 -0500 "Larry Hall (Cygwin)" <reply-to-list-only-lh@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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) 2009-02-10 20:45 ` rhubbell @ 2009-02-10 20:49 ` Larry Hall (Cygwin) 2009-02-19 2:28 ` rhubbell 0 siblings, 1 reply; 26+ messages in thread From: Larry Hall (Cygwin) @ 2009-02-10 20:49 UTC (permalink / raw) To: cygwin 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) 2009-02-10 20:49 ` Larry Hall (Cygwin) @ 2009-02-19 2:28 ` rhubbell 2009-02-19 3:48 ` Larry Hall (Cygwin) 0 siblings, 1 reply; 26+ messages in thread From: rhubbell @ 2009-02-19 2:28 UTC (permalink / raw) To: cygwin On Tue, 10 Feb 2009 15:47:10 -0500 "Larry Hall (Cygwin)" <reply-to-list-only-lh@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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) 2009-02-19 2:28 ` rhubbell @ 2009-02-19 3:48 ` Larry Hall (Cygwin) 0 siblings, 0 replies; 26+ messages in thread From: Larry Hall (Cygwin) @ 2009-02-19 3:48 UTC (permalink / raw) To: cygwin rhubbell wrote: > On Tue, 10 Feb 2009 15:47:10 -0500 > "Larry Hall (Cygwin)" <XXXX> 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) 2009-02-10 20:21 ` RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) Linda Walsh 2009-02-10 20:39 ` Larry Hall (Cygwin) @ 2009-02-10 20:56 ` Tim McDaniel 2009-02-10 21:04 ` Larry Hall (Cygwin) 1 sibling, 1 reply; 26+ messages in thread From: Tim McDaniel @ 2009-02-10 20:56 UTC (permalink / raw) Cc: cygwin On Tue, 10 Feb 2009, Linda Walsh <cygwin@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, 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) 2009-02-10 20:56 ` Tim McDaniel @ 2009-02-10 21:04 ` Larry Hall (Cygwin) 2009-02-10 21:13 ` Ralph Hempel 2009-02-10 22:26 ` Tim McDaniel 0 siblings, 2 replies; 26+ messages in thread From: Larry Hall (Cygwin) @ 2009-02-10 21:04 UTC (permalink / raw) To: cygwin 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) 2009-02-10 21:04 ` Larry Hall (Cygwin) @ 2009-02-10 21:13 ` Ralph Hempel 2009-02-10 22:26 ` Tim McDaniel 1 sibling, 0 replies; 26+ messages in thread From: Ralph Hempel @ 2009-02-10 21:13 UTC (permalink / raw) To: cygwin 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) 2009-02-10 21:04 ` Larry Hall (Cygwin) 2009-02-10 21:13 ` Ralph Hempel @ 2009-02-10 22:26 ` Tim McDaniel 2009-02-10 23:25 ` Larry Hall (Cygwin) 1 sibling, 1 reply; 26+ messages in thread From: Tim McDaniel @ 2009-02-10 22:26 UTC (permalink / raw) To: cygwin 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) 2009-02-10 22:26 ` Tim McDaniel @ 2009-02-10 23:25 ` Larry Hall (Cygwin) 2009-02-11 0:22 ` Tim McDaniel 2009-02-14 5:59 ` RFE: CygWinDir in ENV Linda Walsh 0 siblings, 2 replies; 26+ messages in thread From: Larry Hall (Cygwin) @ 2009-02-10 23:25 UTC (permalink / raw) To: cygwin 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) 2009-02-10 23:25 ` Larry Hall (Cygwin) @ 2009-02-11 0:22 ` Tim McDaniel 2009-02-11 0:48 ` Larry Hall (Cygwin) 2009-02-11 6:00 ` Christopher Faylor 2009-02-14 5:59 ` RFE: CygWinDir in ENV Linda Walsh 1 sibling, 2 replies; 26+ messages in thread From: Tim McDaniel @ 2009-02-11 0:22 UTC (permalink / raw) To: cygwin 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, 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) 2009-02-11 0:22 ` Tim McDaniel @ 2009-02-11 0:48 ` Larry Hall (Cygwin) 2009-02-11 6:00 ` Christopher Faylor 1 sibling, 0 replies; 26+ messages in thread From: Larry Hall (Cygwin) @ 2009-02-11 0:48 UTC (permalink / raw) To: cygwin 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) 2009-02-11 0:22 ` Tim McDaniel 2009-02-11 0:48 ` Larry Hall (Cygwin) @ 2009-02-11 6:00 ` Christopher Faylor 2009-02-11 6:54 ` RFE?: CygWinDir in ENV? tmcd 1 sibling, 1 reply; 26+ messages in thread From: Christopher Faylor @ 2009-02-11 6:00 UTC (permalink / raw) To: cygwin 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: RFE?: CygWinDir in ENV? 2009-02-11 6:00 ` Christopher Faylor @ 2009-02-11 6:54 ` tmcd 0 siblings, 0 replies; 26+ messages in thread From: tmcd @ 2009-02-11 6:54 UTC (permalink / raw) To: cygwin On Wed, 11 Feb 2009, Christopher Faylor wrote: > 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. It's in PATH by default on a Microsoft Windows system, at least on the Windows Server 2003 and Windows XP that I tested it on. > 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. While that's a reasonable idea in general, in my particular case I can't necessarily depend on the user doing that, and on the main machine that I use, the administrator put mingw in the path. -- Tim McDaniel; Reply-To: 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: RFE: CygWinDir in ENV 2009-02-10 23:25 ` Larry Hall (Cygwin) 2009-02-11 0:22 ` Tim McDaniel @ 2009-02-14 5:59 ` Linda Walsh 1 sibling, 0 replies; 26+ messages in thread From: Linda Walsh @ 2009-02-14 5:59 UTC (permalink / raw) To: cygwin Larry Hall (Cygwin) wrote: > Tim McDaniel wrote: >> 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. --- Several shell scripts are called by setup, but I'm not familiar with when they are called or their ordering. But for the programs run from setup -- if CYGWINDIR was set in "setup.exe"'s environment, wouldn't that propagate it to any child processes it started? If that's the case, then either a) if it already calls a post-install script or b) could call a post-install script, AND if it could pass HKLM or HKCU (for all-user vs. current user install) to the script as an arg, the script could just call the windows 'exe' with 'add' to just add the key to the HKCU as an arg (for all-user vs. current user install and the script could use the that to call the reg command. to add the key and to the global or CU location. But this presumes setup calls any scripts after setup and can pass an argument and that it can set the correct value in the environment before calling any other installation binaries or scripts. I've never had any joy in getting cygwin or setup to build on my past systems nor my current system. I can build other packages on linux, (kernel, perl, squid, samba, bash, linux, perl, squid and smaller packages from their tarballs or rpms), but when it comes to cygwin or setup.exe... I have always ended up with missing tools, header files, link files, missing linked systems, wrong version libraries...whatever... always something. I think there is some base set of assumptions that are so simple and normal to each of the communicators (giver/receiver) that neither is aware they exist, let alone able to document or 'verbalize' them as being necessary preconditions. The 'setx.exe' tool mentioned by Lee would be great but for one minor problem. It's not on most people's system. It's included in the Win 2k, and WinXP (and I presume Vista) "Support Tools" or "Release Kit" packages. While I think they are 'free' (past their EULA), I doubt they would be redistributable by a 3rd party. -- 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How does one find where Cygwin was installed from Windows? 2009-02-10 2:55 ` How does one find where Cygwin was installed from Windows? Linda Walsh 2009-02-10 4:22 ` Larry Hall (Cygwin) @ 2009-02-13 23:09 ` Lee D.Rothstein 1 sibling, 0 replies; 26+ messages in thread From: Lee D.Rothstein @ 2009-02-13 23:09 UTC (permalink / raw) To: cygwin > 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How does one find "cygdrive path" in a Win ".bat" file (was Re: Bug in "startXwin.bat") 2009-02-10 0:34 ` How does one find "cygdrive path" in a Win ".bat" file (was Re: Bug in "startXwin.bat") Linda Walsh 2009-02-10 0:57 ` Larry Hall (Cygwin) @ 2009-02-10 9:02 ` Thorsten Kampe 2009-02-10 12:48 ` Eric Blake 1 sibling, 1 reply; 26+ messages in thread From: Thorsten Kampe @ 2009-02-10 9:02 UTC (permalink / raw) To: cygwin * Linda Walsh (Mon, 09 Feb 2009 16:34:21 -0800) > > Larry Hall (Cygwin X) wrote: > > Linda Walsh wrote: > >> The startxwin.sh script works, but startxwin.bat does not work if > >> your Cygwin installation isn't in the default location. > >> > >> You could use "mount -p" (presuming your cygwin\bin is in your windows > >> path, as mine is). > >> > >> If not, need to look in the registry: > >> "\HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts > >> v2\cygdrive prefix" > > > > No, you don't need to look in the registry. There's nothing there that > > 'mount' won't tell you. Forget about the registry. You'll be better > > off, especially when Cygwin 1.7 is released. > --- > I'm curious -- how does mount find or 'know' the cygdrive path > if it doesn't come from the registry. /etc/fstab > For that matter, how would a windows .bat file find the > 'mount.exe' binary if the .bat file doesn't know 'cygdrive path'? Mount is not a Cygwin application (meaning it doesn't have to know where cygwin1.dll is). So the bat file simply has to specify the path to mount.exe. Thorsten -- 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How does one find "cygdrive path" in a Win ".bat" file (was Re: Bug in "startXwin.bat") 2009-02-10 9:02 ` How does one find "cygdrive path" in a Win ".bat" file (was Re: Bug in "startXwin.bat") Thorsten Kampe @ 2009-02-10 12:48 ` Eric Blake 0 siblings, 0 replies; 26+ messages in thread From: Eric Blake @ 2009-02-10 12:48 UTC (permalink / raw) To: cygwin -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Thorsten Kampe on 2/10/2009 2:01 AM: >> For that matter, how would a windows .bat file find the >> 'mount.exe' binary if the .bat file doesn't know 'cygdrive path'? > > Mount is not a Cygwin application (meaning it doesn't have to know where > cygwin1.dll is). So the bat file simply has to specify the path to > mount.exe. Wrong. Mount _is_ a cygwin app. But provided that /bin/mount and /bin/cygwin1.dll are installed in the same directory (which they should be), finding mount means you have found cygwin1.dll and thus have found /. - -- Don't work too hard, make some time for fun as well! Eric Blake ebb9@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkmRd6UACgkQ84KuGfSFAYDUjACgkMp3o9bAJdkm/zICWAR4r+GN q/cAn1vHo3yrpj5h1mn7kx2ZEXHfyuBh =ql/z -----END PGP SIGNATURE----- -- 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/ ^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2009-02-19 3:48 UTC | newest] Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <4990B031.4050807@tlinx.org> [not found] ` <4990B128.7030004@cygwin.com> 2009-02-10 0:34 ` How does one find "cygdrive path" in a Win ".bat" file (was Re: Bug in "startXwin.bat") Linda Walsh 2009-02-10 0:57 ` Larry Hall (Cygwin) 2009-02-10 1:30 ` Ralph Hempel 2009-02-10 1:37 ` How does one find "cygdrive path" in a Win ".bat" file Linda Walsh 2009-02-10 2:07 ` Larry Hall (Cygwin) 2009-02-10 2:55 ` How does one find where Cygwin was installed from Windows? Linda Walsh 2009-02-10 4:22 ` Larry Hall (Cygwin) 2009-02-10 20:21 ` RFE?: CygWinDir in ENV? (was Re: How does one find where Cygwin was installed from Windows?) Linda Walsh 2009-02-10 20:39 ` Larry Hall (Cygwin) 2009-02-10 20:45 ` rhubbell 2009-02-10 20:49 ` Larry Hall (Cygwin) 2009-02-19 2:28 ` rhubbell 2009-02-19 3:48 ` Larry Hall (Cygwin) 2009-02-10 20:56 ` Tim McDaniel 2009-02-10 21:04 ` Larry Hall (Cygwin) 2009-02-10 21:13 ` Ralph Hempel 2009-02-10 22:26 ` Tim McDaniel 2009-02-10 23:25 ` Larry Hall (Cygwin) 2009-02-11 0:22 ` Tim McDaniel 2009-02-11 0:48 ` Larry Hall (Cygwin) 2009-02-11 6:00 ` Christopher Faylor 2009-02-11 6:54 ` RFE?: CygWinDir in ENV? tmcd 2009-02-14 5:59 ` RFE: CygWinDir in ENV Linda Walsh 2009-02-13 23:09 ` How does one find where Cygwin was installed from Windows? Lee D.Rothstein 2009-02-10 9:02 ` How does one find "cygdrive path" in a Win ".bat" file (was Re: Bug in "startXwin.bat") Thorsten Kampe 2009-02-10 12:48 ` Eric Blake
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).