X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Thu, 13 May 2010 15:29:19 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Determining if cygwin is installed on a system Message-ID: <20100513192919.GA23042@ednor.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20100513191552 DOT GQ29943 AT trikaliotis DOT net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100513191552.GQ29943@trikaliotis.net> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 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