This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: A good way to test if Cygwin isn't installed?


luke.kendall@cisra.canon.com.au wrote:
> I just wanted to run an idea past the list.
> 
> I want to write a shell script to test if Cygwin has been installed on
> the machine running the shell script.
> 
> I do this by running a shell (from a network install of Cygwin if
> necessary). 
> 
> If Cygwin is installed on the local machine, then "cygpath -w /"
> returns something like "c:\cygwin".  (Good for discovering what drive
> Cygwin was installed on, right?)  If Cygwin has not been installed,
> "cygpath -w /" returns a plain old backslash.
> 
> That's fine - maybe even great.  My question: is that a
> reliable way to
> perform that test?  It seems good to me.
> 
> I'm working my way towards a shell script that installs or upgrades
> Cygwin on a machine that may or may not have Cygwin installed, and do
> all our local post-install stuff (which is a lot of stuff), and also
> test that at least the major packages from the install work properly.

What if you don't have cygwin in your path until it's started?
Wouldn't it be better to check to see if the cygwin hive is present in the
registry,
and if necessary verify the mount data from there?

Bill
-- 
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.tigris.org

This e-mail transmission is strictly confidential and intended solely
for the person or organisation to whom it is addressed. It may contain
privileged and confidential information and if you are not the intended
recipient, you must not copy, distribute or take any action in reliance
on it. If you have received this email in error, please reply to the
sender as soon as possible and delete the message. Please note that we
are able to, and reserve the right to, monitor e-mail communications
passing through our network.

The views expressed in this email are not that of the company unless
specified within the message.

The inclusion of this footnote indicates that the mail message and any
attachments have been checked for the presence of known viruses.

If you have any comments regarding our policy please direct them to
postmaster@cox.co.uk
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]