Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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: MIME-Version: 1.0 Content-Type: TEXT/plain; CHARSET=US-ASCII 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/