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: Determining if cygwin is installed on a system


On Thu, May 13, 2010 at 09:15:52PM +0200, Spiro Trikaliotis wrote:
>Hello,
>
>I have been tasked with generating a script and installing it on all the
>machines on our corporate network. For this, I want to use Cygwin.
>
>One of the requirements is that people should be able to install it as
>easy as possible. I am thinking about installing cygwin with a .BAT
>file.
>
>However, before doing this, I want to determine if there is already a
>cygwin installed. In this case, I want to instruct the user to do it on
>his own (people who already have cygwin installed are more technically
>savvy, and more likely that they would NOT want me to mess with their
>system). On the other systems, I would either use setup.exe with
>command-line parameters, or just copy the needed files (yes, I know the
>latter is not supported.)
>
>Thus, my main concern now is: How can I determine if a version of cygwin
>is installed? I could search for cygwin1.dll on the whole system, but
>this would need some time. I could look into the path only, but then, I
>might miss a cygwin1.dll.
>
>Does anyone have a good idea? I should be able to determine at least
>cygwin 1.5 and 1.7.
>
>Thank you for every hint and suggestion.

Take a look at the source code for Cygwin's cygcheck.cc.  It checks for
existing Cygwin installations by scanning the registry.  The registry
locations did change between Cygwin 1.5.x and 1.7.x but it should still
be relatively straightforward.  You can also look at setup.exe which
also does some checks.

The other alternative is to just bundle cygcheck.exe and use that in
your script.  As long as you're using this only inside your company
and there is no possibility that it will be distributed, you don't
even have to worry about making source code available to your inhouse
users.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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