From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b97aa4480eccc494 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!out02a.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!in03.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: How to get the application path References: <46a456aa$0$25908$426a34cc@news.free.fr> <1185204459.328520.240930@z24g2000prh.googlegroups.com> <46a5e4e1$0$27850$39db0f71@news.song.fi> <0kbqe1zcrk.fsf@hod.lan.m-e-leypold.de> From: Stephen Leake Date: Thu, 26 Jul 2007 06:39:11 -0400 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:Y2ymuIM9Uq46jAZn1Nbew2dJG5I= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: e105446a879ce759e00d419824 Xref: g2news2.google.com comp.lang.ada:1201 Date: 2007-07-26T06:39:11-04:00 List-Id: Markus E Leypold writes: > Now, on Unix I'd just put a shell script wrapper in place of the executable: Why do you limit this to "Unix"? Any operating system that supports shells can do the same thing. > MYPATH="$0" > MYAPP="$(which $MYPATH.bin)" # locate the executable proper > > export EXE_PATH="$MYPATH" > > exec $MYAPP "$@" > > (untested, mind you). > > That would even put the full path in argv[0]. The power of shell > script wrappers in Unix is usually underestimated. Scratch the "in Unix", and I agree. A Windows icon can launch a cmd shell wrapper. Or a Cygwin bash wrapper, for that matter! -- -- Stephe