delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/10/05/03:20:19

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Tue, 5 Oct 2004 17:19:54 +1000 (EST)
From: luke DOT kendall AT cisra DOT canon DOT com DOT au
Subject: RE: A good way to test if cygwin isn't installed?
To: cygwin AT cygwin DOT com
In-Reply-To: <Pine.GSO.4.61.0410031426390.1071@slinky.cs.nyu.edu>
MIME-Version: 1.0
Message-Id: <20041005071954.E4FF885135@pessard.research.canon.com.au>

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. 
>  	Igor 

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
test.

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
way:

    # 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.

luke


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019