X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:to:from:subject:message-id:date:mime-version
	:content-type:content-transfer-encoding; q=dns; s=default; b=qvj
	x187BdrWOa7VJrqrzd2OeVTYrlvzD11WG+dSrGA5fo31lJvnRLrd1qTQlagP2tBQ
	2FTlR9L17eJ/ScezBgF1a7pDcnZuS4WfIylnWBnuoDnuD6X/1I2EEOu6w2vy1Zjb
	I0ELF07avGQm3hfHzvwjAsMBC9J88qpKgmbBBIZQ=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:to:from:subject:message-id:date:mime-version
	:content-type:content-transfer-encoding; s=default; bh=hv1Rv+gI+
	4pfBjAnLv9T3HctFc8=; b=T+H2jYW+/fg30pX2bTiUCbec3bVtQAwMhMcmvjl0t
	1dJ6q1vc0B/72MvhdgXCL3LiSUgZ895/bN1HNs+ilqTN7rgPMys4Dey+5ZQR6nkV
	xE0R0d6QAbBqBgp5eMwvdTBZ6ltC+xZziZbgpBWMV4GhWxkmNnBDnjBHfVXfFnh+
	1M=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.6 required=5.0 tests=BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=HX-Envelope-From:sk:Christi, H*M:online, fdisk, H*MI:online
X-HELO: mailout04.t-online.de
To: cygwin@cygwin.com
From: Christian Franke <Christian.Franke@t-online.de>
Subject: Proposal for new cygwin.bat which is independent from install directory
Message-ID: <57C06CFA.4060405@t-online.de>
Date: Fri, 26 Aug 2016 18:23:22 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Traditionally setup.exe creates the /cygwin.bat file as follows if 
C:\cygwin is the install directory:
-----
@echo off

C:
chdir C:\cygwin\bin

bash --login -i
-----


The following should work since WinXP regardless of install directory:
-----
@echo off

cd /d %~dp0
if errorlevel 1 exit /b 1
cd bin
if errorlevel 1 exit /b 1

bash --login -i
-----

I would suggest to add something like the above as 
"/etc/defaults/cygwin.bat" to base-files package. The postinstall script 
should copy it to "/cygwin.bat" if new. The creation of this file could 
later be removed from setup.exe.

This more generic cygwin.bat is in particular useful for 'portable' 
installations of Cygwin on an USB device. I occasionally use such a 
installation to make rescue tools (dd, ddrescue, fdisk, hexedit, 
sleuthkit, ...) available to the minimal system provided by a Windows 
system repair CD.

Christian


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

