This is the mail archive of the
mailing list for the Cygwin project.
RE: A good way to test if cygwin isn't installed?
- From: luke dot kendall at cisra dot canon dot com dot au
- To: cygwin at cygwin dot com
- Date: Tue, 5 Oct 2004 17:19:54 +1000 (EST)
- Subject: RE: A good way to test if cygwin isn't installed?
On 3 Oct, Igor Pechtchanski wrote:
> > Having mount.exe and cygwin1.dll in a specific dir and then run "mount -m"
> > after "set PATH=." should be the way to go.
> Yes, that was the idea.
Well, I was running this script from a version of Cygwin installed on
the network. In other words, I want to avoid writing DOS batch scripts
(since they really are such a sad waste of time).
Bill Hughes's post of jscript + Windows scripting host looked
interesting, but I didn't see a clear advantage to using that than to
using Cygwin from the network: especially since the scripting host is
only available on newer Windows OS versions - so it's not portable.
And thanks to those who seemed to say that using mount is a good way to
I was interested to see that seeing mount points only of the form
/$CYGDRIVE_MNT/$DRIVE_LETTER/path-to-somewhere is a good indicator that
Cygwin is not installed. Where CYGDRIVE_MNT can be determined this
# Set CYGDRIVE_MNT to the mount point to be inserted in front of absolute
# path names used to refer to drive mappings. By default the mount point
# is /cygdrive, but if the user has set it to be / then $CYGDRIVE_MNT will
# be empty. Basically, the user can choose /mnt or anything they like.
CYGDRIVE_MNT=`mount -p | sed -n '2s| .*||;s|^/$||;2p'`
Overall though, all that seems more complicated than just using "cygpath
-w /", ("cygpath /" surely must use the mount info?), so I trust this
is equivalent - and simpler for a script!
As I mentioned, when I performed the experiment on a PC with Cygwin not
installed, the output from "cygpath -w /" consisted of just a single
backslash, which is an easy thing to check.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html