delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/08/26/12:26:32

X-Recipient: archive-cygwin AT delorie DOT 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 AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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 AT cygwin DOT com
From: Christian Franke <Christian DOT Franke AT t-online DOT 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
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019