comp.lang.ada
 help / color / mirror / Atom feed
From: development-2006-8ecbb5cc8aREMOVETHIS@ANDTHATm-e-leypold.de (Markus E.L.)
Subject: Re: How to get the application path
Date: Tue, 31 Jul 2007 01:38:17 +0200
Date: 2007-07-31T01:38:17+02:00	[thread overview]
Message-ID: <o6vec14g46.fsf@hod.lan.m-e-leypold.de> (raw)
In-Reply-To: uwswn5u0g.fsf@stephe-leake.org


> Markus E Leypold <development-2006-8ecbb5cc8aREMOVETHIS@ANDTHATm-e-leypold.de> 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. 

Yes+No. In Unix I can just exec the real binary, so I don't have a
shell process waiting until the the binary proper returns. In Windows
the shell process will (AFAI understand it) exist until the
application terminates and AFAIS (worse) it will even have a command
line window open to the absolute irritation of the lay user. 

If I do the right things (use start.exe, for once) the shell window
will open only shortly, but will still irritate the user.

I find the Unix way more palatable.

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

Could you tell me the equivalent of my script in CMD.exe? (Seriously,
that's a real question: What I got until now I consider kludgy).

> A Windows icon can launch a cmd shell wrapper. Or a Cygwin bash
> wrapper, for that matter!

Yes, but cygwin has problems of its own (security for once, it's
rather intrusive), so it's not OK in my opinion to run it at end user
machines (at least w/o much further research to be done which is a bit
difficult given the general attitude ("BWAM") at the cygwin mailing
lists :-(.)


Regards -- Markus



  reply	other threads:[~2007-07-30 23:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-23  7:20 How to get the application path Rangdalf
2007-07-23 12:06 ` qouify
2007-07-23 12:34 ` Stephen Leake
2007-07-23 15:27   ` Adam Beneschan
2007-07-23 16:27     ` Markus E Leypold
2007-07-24 11:14       ` Stephen Leake
2007-07-24 11:35         ` Markus E Leypold
2007-07-23 16:37     ` Dmitry A. Kazakov
2007-07-24 11:11     ` Stephen Leake
2007-07-24 11:44       ` Niklas Holsti
2007-07-24 19:33         ` Randy Brukardt
2007-07-24 20:30           ` Niklas Holsti
2007-07-24 22:01             ` Markus E Leypold
2007-07-24 21:56           ` Markus E Leypold
2007-07-26 10:39             ` Stephen Leake
2007-07-30 23:38               ` Markus E.L. [this message]
2007-08-02  4:31                 ` Randy Brukardt
2007-08-02 22:23                   ` Markus E.L. 2
2007-07-24 14:07       ` Robert A Duff
2007-07-24 14:58         ` Adam Beneschan
2007-07-25 10:05         ` Stephen Leake
2007-07-24 14:55       ` Adam Beneschan
2007-07-24 15:41         ` Markus E Leypold
2007-07-25 19:13           ` Randy Brukardt
2007-07-23 18:51 ` Georg Bauhaus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox