* Can I find where cygwin is installed (for automation purposes)
@ 2020-04-15 10:29 Paul Moore
2020-04-15 10:51 ` Csaba Raduly
2020-04-15 10:53 ` Csaba Ráduly
0 siblings, 2 replies; 11+ messages in thread
From: Paul Moore @ 2020-04-15 10:29 UTC (permalink / raw)
To: cygwin
I'm trying to write an automation script that works on a number of
machines. I know that on all machines Cygwin will be installed, but I
cannot guarantee that (1) it will be in the same location on each PC,
or (2) that it will be in PATH.
There's HKCU\Software\Cygwin\Installations, but that seems to use \??
prefixes on the PATH, which I'm not sure how to interpret (I know
about \\?\ prefixes, but this is different, I assume?), and it also
includes some non-Cygwin things (one machine I have, has
\??\C:\PROGRA~1\ConEmu\ConEmu
So far, the best I can see is to try every entry in there, strip \??,
and look for a cygwin1.dll, and use the first entry I find that works.
But that seems a bit arbitrary. Is there a better way?
Thanks,
Paul
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Can I find where cygwin is installed (for automation purposes)
2020-04-15 10:29 Can I find where cygwin is installed (for automation purposes) Paul Moore
@ 2020-04-15 10:51 ` Csaba Raduly
2020-04-15 12:42 ` Thomas Wolff
2020-04-15 10:53 ` Csaba Ráduly
1 sibling, 1 reply; 11+ messages in thread
From: Csaba Raduly @ 2020-04-15 10:51 UTC (permalink / raw)
To: Paul Moore; +Cc: cygwin list
Hi Paul,
On Wed, Apr 15, 2020 at 12:30 PM Paul Moore via Cygwin <cygwin@cygwin.com>
wrote:
> I'm trying to write an automation script that works on a number of
> machines. I know that on all machines Cygwin will be installed, but I
> cannot guarantee that (1) it will be in the same location on each PC,
> or (2) that it will be in PATH.
>
> There's HKCU\Software\Cygwin\Installations, but that seems to use \??
> prefixes on the PATH, which I'm not sure how to interpret
>
On my machine, I have a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup
key, which contains a string value named "rootdir" with the date
"C:\cygwin64".
Csaba
--
You can get very substantial performance improvements
by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler
So if you're looking for a completely portable, 100% standards-conformant
way
to get the wrong information: this is what you want. - Scott Meyers
(C++TDaWYK)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Can I find where cygwin is installed (for automation purposes)
2020-04-15 10:29 Can I find where cygwin is installed (for automation purposes) Paul Moore
2020-04-15 10:51 ` Csaba Raduly
@ 2020-04-15 10:53 ` Csaba Ráduly
2020-04-15 13:29 ` Paul Moore
1 sibling, 1 reply; 11+ messages in thread
From: Csaba Ráduly @ 2020-04-15 10:53 UTC (permalink / raw)
To: cygwin
Hi Paul,
On 15/04/2020 12:29, Paul Moore via Cygwin wrote:
> I'm trying to write an automation script that works on a number of
> machines. I know that on all machines Cygwin will be installed, but I
> cannot guarantee that (1) it will be in the same location on each PC,
> or (2) that it will be in PATH.
>
> There's HKCU\Software\Cygwin\Installations, but that seems to use \??
> prefixes on the PATH, which I'm not sure how to interpret
...
On my machine, I have a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup
key, which contains a string value named "rootdir" with the date "C:\cygwin64".
Csaba
--
You can get very substantial performance improvements
by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler
So if you're looking for a completely portable, 100% standards-conformat way
to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Can I find where cygwin is installed (for automation purposes)
2020-04-15 10:51 ` Csaba Raduly
@ 2020-04-15 12:42 ` Thomas Wolff
2020-04-15 13:30 ` Paul Moore
0 siblings, 1 reply; 11+ messages in thread
From: Thomas Wolff @ 2020-04-15 12:42 UTC (permalink / raw)
To: cygwin
Am 15.04.2020 um 12:51 schrieb Csaba Raduly via Cygwin:
> Hi Paul,
>
> On Wed, Apr 15, 2020 at 12:30 PM Paul Moore via Cygwin <cygwin@cygwin.com>
> wrote:
>
>> I'm trying to write an automation script that works on a number of
>> machines. I know that on all machines Cygwin will be installed, but I
>> cannot guarantee that (1) it will be in the same location on each PC,
>> or (2) that it will be in PATH.
>>
>> There's HKCU\Software\Cygwin\Installations, but that seems to use \??
>> prefixes on the PATH, which I'm not sure how to interpret
Running that script within cygwin? `mount | grep " / "`
>
> On my machine, I have a
>
> HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup
>
> key, which contains a string value named "rootdir" with the date
> "C:\cygwin64".
>
> Csaba
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Can I find where cygwin is installed (for automation purposes)
2020-04-15 10:53 ` Csaba Ráduly
@ 2020-04-15 13:29 ` Paul Moore
2020-04-15 15:53 ` Marco Atzeri
0 siblings, 1 reply; 11+ messages in thread
From: Paul Moore @ 2020-04-15 13:29 UTC (permalink / raw)
To: Csaba Ráduly; +Cc: cygwin
On Wed, 15 Apr 2020 at 11:54, Csaba Ráduly via Cygwin <cygwin@cygwin.com> wrote:
> On my machine, I have a
>
> HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup
>
> key, which contains a string value named "rootdir" with the date "C:\cygwin64".
Thanks, that looks more useful. I didn't think to check there as I
didn't recall having run the setup as "All users" so I assumed
everything would be in HKCU. I should have checked!
Paul
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Can I find where cygwin is installed (for automation purposes)
2020-04-15 12:42 ` Thomas Wolff
@ 2020-04-15 13:30 ` Paul Moore
0 siblings, 0 replies; 11+ messages in thread
From: Paul Moore @ 2020-04-15 13:30 UTC (permalink / raw)
To: Thomas Wolff; +Cc: cygwin
On Wed, 15 Apr 2020 at 13:43, Thomas Wolff <towo@towo.net> wrote:
> >> There's HKCU\Software\Cygwin\Installations, but that seems to use \??
> >> prefixes on the PATH, which I'm not sure how to interpret
> Running that script within cygwin? `mount | grep " / "`
As I said, I'm trying to find cygwin, so I can't run anything from
within cygwin at this point :-(
Paul
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Can I find where cygwin is installed (for automation purposes)
2020-04-15 13:29 ` Paul Moore
@ 2020-04-15 15:53 ` Marco Atzeri
2020-04-15 18:10 ` Paul Moore
0 siblings, 1 reply; 11+ messages in thread
From: Marco Atzeri @ 2020-04-15 15:53 UTC (permalink / raw)
To: cygwin
Am 15.04.2020 um 15:29 schrieb Paul Moore via Cygwin:
> On Wed, 15 Apr 2020 at 11:54, Csaba Ráduly via Cygwin <cygwin@cygwin.com> wrote:
>
>> On my machine, I have a
>>
>> HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup
>>
>> key, which contains a string value named "rootdir" with the date "C:\cygwin64".
>
> Thanks, that looks more useful. I didn't think to check there as I
> didn't recall having run the setup as "All users" so I assumed
> everything would be in HKCU. I should have checked!
> Paul
> --
Pay attention that Setup links to the last updated one 64 or 32bit
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\Setup
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Cygwin\Setup
Installations report all if more are installed (borderline case, maybe)
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\Installations
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Cygwin\Installations
both version 32 and 64 bit are reported on
Computer\HKEY_CURRENT_USER\Software\Cygwin\Installations
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Can I find where cygwin is installed (for automation purposes)
2020-04-15 15:53 ` Marco Atzeri
@ 2020-04-15 18:10 ` Paul Moore
2020-04-15 18:30 ` René Berber
0 siblings, 1 reply; 11+ messages in thread
From: Paul Moore @ 2020-04-15 18:10 UTC (permalink / raw)
To: Marco Atzeri; +Cc: cygwin
On Wed, 15 Apr 2020 at 16:54, Marco Atzeri via Cygwin <cygwin@cygwin.com> wrote:
>
> Am 15.04.2020 um 15:29 schrieb Paul Moore via Cygwin:
> > On Wed, 15 Apr 2020 at 11:54, Csaba Ráduly via Cygwin <cygwin@cygwin.com> wrote:
> >
> >> On my machine, I have a
> >>
> >> HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup
> >>
> >> key, which contains a string value named "rootdir" with the date "C:\cygwin64".
> >
> > Thanks, that looks more useful. I didn't think to check there as I
> > didn't recall having run the setup as "All users" so I assumed
> > everything would be in HKCU. I should have checked!
> > Paul
> > --
>
>
> Pay attention that Setup links to the last updated one 64 or 32bit
>
> Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\Setup
> Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Cygwin\Setup
>
> Installations report all if more are installed (borderline case, maybe)
>
> Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\Installations
> Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Cygwin\Installations
>
> both version 32 and 64 bit are reported on
>
> Computer\HKEY_CURRENT_USER\Software\Cygwin\Installations
Thanks. Can you explain what the \?? prefix on the Installations
values is about? I'm nervous that there's something going on there
that means that just ignoring the first 3 characters isn't
sufficient... ;-)
Paul
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Can I find where cygwin is installed (for automation purposes)
2020-04-15 18:10 ` Paul Moore
@ 2020-04-15 18:30 ` René Berber
2020-04-15 18:39 ` Paul Moore
0 siblings, 1 reply; 11+ messages in thread
From: René Berber @ 2020-04-15 18:30 UTC (permalink / raw)
To: cygwin
On 4/15/2020 1:10 PM, Paul Moore via Cygwin wrote:
[snip]
> Thanks. Can you explain what the \?? prefix on the Installations
> values is about? I'm nervous that there's something going on there
> that means that just ignoring the first 3 characters isn't
> sufficient... ;-)
https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats
Look for "DOS device paths"
--
R.B.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Can I find where cygwin is installed (for automation purposes)
2020-04-15 18:30 ` René Berber
@ 2020-04-15 18:39 ` Paul Moore
2020-04-15 20:49 ` René Berber
0 siblings, 1 reply; 11+ messages in thread
From: Paul Moore @ 2020-04-15 18:39 UTC (permalink / raw)
To: René Berber; +Cc: cygwin
On Wed, 15 Apr 2020 at 19:31, René Berber via Cygwin <cygwin@cygwin.com> wrote:
>
> On 4/15/2020 1:10 PM, Paul Moore via Cygwin wrote:
>
> [snip]
> > Thanks. Can you explain what the \?? prefix on the Installations
> > values is about? I'm nervous that there's something going on there
> > that means that just ignoring the first 3 characters isn't
> > sufficient... ;-)
>
> https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats
>
> Look for "DOS device paths"
Thanks. That's \\?\C:\... and what I'm seeing is \??\C:\...
Is that just a typo/bug? That's the discrepancy that was confusing me :-(
Paul
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Can I find where cygwin is installed (for automation purposes)
2020-04-15 18:39 ` Paul Moore
@ 2020-04-15 20:49 ` René Berber
0 siblings, 0 replies; 11+ messages in thread
From: René Berber @ 2020-04-15 20:49 UTC (permalink / raw)
Cc: cygwin
On 4/15/2020 1:39 PM, Paul Moore via Cygwin wrote:
>> https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats
>>
>> Look for "DOS device paths"
>
> Thanks. That's \\?\C:\... and what I'm seeing is \??\C:\...
>
> Is that just a typo/bug? That's the discrepancy that was confusing me :-(
A bug.
If setup.exe stores those paths, then its a bug there.
You could have tested that easily, on a cmd window:
C:\Users\reneb>dir \\?\C:\
Volume in drive \\?\C: is OS
Volume Serial Number is 922E-C431
Directory of \\?\C:
12/09/2019 02:52 PM <DIR> Apps
01/04/2020 03:11 PM <DIR> Boot
04/05/2020 12:12 PM <DIR> cygwin64
...
12/24/2019 08:09 PM <DIR> Users
04/14/2020 05:45 PM <DIR> Windows
0 File(s) 0 bytes
14 Dir(s) 0 bytes free
C:\Users\reneb>dir \?\C:\
The filename, directory name, or volume label syntax is incorrect.
--
R.B.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2020-04-15 20:49 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15 10:29 Can I find where cygwin is installed (for automation purposes) Paul Moore
2020-04-15 10:51 ` Csaba Raduly
2020-04-15 12:42 ` Thomas Wolff
2020-04-15 13:30 ` Paul Moore
2020-04-15 10:53 ` Csaba Ráduly
2020-04-15 13:29 ` Paul Moore
2020-04-15 15:53 ` Marco Atzeri
2020-04-15 18:10 ` Paul Moore
2020-04-15 18:30 ` René Berber
2020-04-15 18:39 ` Paul Moore
2020-04-15 20:49 ` René Berber
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).