comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: How to get the application path
Date: Wed, 25 Jul 2007 14:13:44 -0500
Date: 2007-07-25T14:13:44-05:00	[thread overview]
Message-ID: <f8878s$go6$1@jacob-sparre.dk> (raw)
In-Reply-To: 5lr6mx6c7b.fsf@hod.lan.m-e-leypold.de

"Markus E Leypold"
<development-2006-8ecbb5cc8aREMOVETHIS@ANDTHATm-e-leypold.de> wrote in
message news:5lr6mx6c7b.fsf@hod.lan.m-e-leypold.de...
>
> > On Jul 24, 4:11 am, Stephen Leake <stephen_le...@stephe-leake.org>
> > wrote:
> >
> >> > I really have to question this.  I tried it using GNAT on Linux, and
> >> > (as I expected) Command_Name simply returns whatever was the first
> >> > token I entered on the shell command line---i.e. argv[0] (which is
> >> > what the Ada 95 manual hints that Command_Name should return).
> >>
> >> Yes, that is exactly what it does.
> >>
> >> I guess in the cases I use it, I always launch a program by specifying
> >> its full path.
> >>
> >> That is typically the case for launching from an icon, for example.
> >
> > What's an icon? :) :)
> >
> > Seriously, I'm enougb of a dinosaur that I still use command lines for
> > everything, most of the time.  (Even on Windows.)  I still think it's
> > the coolest thing that I don't have to punch my commands onto
> > Hollerith cards any more.
>
> I think thepoint is not that the OP wants icons. The problem is to
> find the application's installation directory (where all other
> spplication data is, often including configuration) when the
> application has been started from e.g. a windows desktop.

On Windows, you need to find that in the registry. The application path for
configuration purposes is not necessarily the same as the path that it was
launched from.

Claw has a bunch of routines for setting and retriving the application path
in the Claw.Registry.Shell package.

Another way to say this is that it can't be done portably, at least if you
are going to follow the OS "standards" for such things. Otherwise, you
should just do it yourself and not worry about what the OS thinks.

                             Randy.





  reply	other threads:[~2007-07-25 19:13 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.
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 [this message]
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