[comp.windows.ms] PATH for Windows applications

hadgraft@vaxc.cc.monash.edu.au (Hadgraft) (06/06/91)

One of the things I find annoying about most major Windows applications, is that
their directories must be included in the PATH. If you use a number of them,
your PATH gets quite long. There is such a simple solution to this problem, that
I can't believe that so many developers don't use it. All an application has to
do is store the home directory in WIN.INI or its own .INI file. Problem solved.
Then my path wouldn't have to look like this:

c:\windows;c:\winmisc;c:\pif;c:\winword;c:\excel3;c:\toolbook; etc

Even Windows shouldn't need to have the Windows directory in the PATH. There
should be entried in WIN.INI like this:

homedir=c:\windows
pifdir=c:\pif

I am
planning to write a replacement for STARTUP.EXE which stores the directory for
major applications in WIN.INI. When you startup a particular application, it
will append the correct directory to the PATH, and start the application.

Perhaps noone else sees this as a problem. I'd be interested in your views.
--
  +--------------------------------------+
  |  Roger Hadgraft                 +----------------------------------+
  |  Senior Lecturer                |  hadgraft@civeng.monash.edu.au   |
  |  Dept of Civil Engineering      |  phone:  +61 3 565 4983          |
  |  Monash University              |  fax:    +61 3 565 4944 or 3409  |
  |  Clayton, Vic. 3168. Australia. +----------------------------------+
  +--------------------------------------+

akm@obelix.cs.uoregon.edu (Anant Kartik Mithal) (06/07/91)

In article <1991Jun6.095516.86840@vaxc.cc.monash.edu.au> hadgraft@vaxc.cc.monash.edu.au (Hadgraft) writes:
>One of the things I find annoying about most major Windows applications, is that
>their directories must be included in the PATH. If you use a number of them,
>your PATH gets quite long. 
>Perhaps noone else sees this as a problem. I'd be interested in your views.

I don't have this problem, and here is why...

I'll try and describe my setup with Excel and Winword as examples.
Some directory info:

Windows 	d:\windows
Winword		d:\winword
Excel		e:\excel

Path on entering windows (something like):
	c:\;c:\dos;c:\utilitys;d:\windows;d:\windows\utilitys;d:\windows\pif
		e:\memacs

Note that this does not include either winword or excel

In the extensions part of Win.ini, I have the following:

doc=d:\winword\winword.exe
xl?=d:\excel\excel.exe

I also have usher set up to run excel and winword with the complete
path name defined. As a result, if I run either from my shell (usher),
the full path info is available, so I don't have a problem. If I
double click on an icon, then windows knows the full path, so that
isn't a problem either.

On the other hand, I do have a problem with memacs, which insists on
being in the path, and grumbles about not being able to find its
various .cmd files if it isn't in the path.

Hope this helps,

kartik
-- 
Anant Kartik Mithal                                     akm@cs.uoregon.edu
Research Assistant, 					(503)346-4408 (msgs)
Department of Computer Science,                         (503)346-3989 (direct)
University of Oregon, Eugene, OR 97403-1202

Aengus Lawlor <RBYAML@ROHVM1.BITNET> (06/07/91)

In article <1991Jun6.184053.12028@cs.uoregon.edu>, akm@obelix.cs.uoregon.edu
(Anant Kartik Mithal) says:
>
>In article <1991Jun6.095516.86840@vaxc.cc.monash.edu.au>
>hadgraft@vaxc.cc.monash.edu.au (Hadgraft) writes:
>>One of the things I find annoying about most major Windows applications, is
>that
>>their directories must be included in the PATH. If you use a number of them,
>>your PATH gets quite long.
>>Perhaps noone else sees this as a problem. I'd be interested in your views.
>
>I don't have this problem, and here is why...
>
>I'll try and describe my setup with Excel and Winword as examples.
>Some directory info:
>
>Windows         d:\windows
>Winword         d:\winword
>Excel           e:\excel
>
>Path on entering windows (something like):
>        c:\;c:\dos;c:\utilitys;d:\windows;d:\windows\utilitys;d:\windows\pif
>                e:\memacs
>
>Note that this does not include either winword or excel
>
>In the extensions part of Win.ini, I have the following:
>
>doc=d:\winword\winword.exe
>xl?=d:\excel\excel.exe
>
>I also have usher set up to run excel and winword with the complete
>path name defined. As a result, if I run either from my shell (usher),
>the full path info is available, so I don't have a problem. If I
>double click on an icon, then windows knows the full path, so that
>isn't a problem either.
>
>On the other hand, I do have a problem with memacs, which insists on
>being in the path, and grumbles about not being able to find its
>various .cmd files if it isn't in the path.
>
I use Extra! for Windows (3270 emulation), and one of it's (very) annoying
habits is that it changes directory to the extrawin dir, so that when you
exit windows you aren't in the dir you started out in. Has anyone else
encountered this, and been bothered enough to do something about it?

Aengus
--
RBYAML@ROHMHAAS.COM                    Aengus Lawlor
RBYAML@ROHVM1.BITNET                   (who used to be ALAWLOR@DIT.IE)
"How about some of that famous Dublin wit, Barman?"
"Certainly, sir. Would that be Dry or Sparkling?"

nar@praxis.co.uk (Nick Rozanski) (06/07/91)

In article <1991Jun6.095516.86840@vaxc.cc.monash.edu.au> hadgraft@vaxc.cc.monash.edu.au (Hadgraft) writes:
>One of the things I find annoying about most major Windows applications, is that
>their directories must be included in the PATH. If you use a number of them,
>your PATH gets quite long.

This isn't just annoying, it can be downright inconvenient.  DOS imposes a
limit of (I think) 127 characters on the length of PATH.  If you have a number
of applications which you regularly use, your PATH becomes too long.  I have
had to get round this by renaming all of our directories to short names, eg
"W3" and "WW".  (I didn't want to confuse everybody with SUBST'ed drives).




-- 
Nick Rozanski
Praxis South-East Ltd, Church House, Church Street, Staines, Middlesex TW18 4EP
Tel:	+44-784-460694.   Email:   nar@praxis.co.uk

ole@edb.tih.no (Ole Nymoen) (06/07/91)

In article <1991Jun6.095516.86840@vaxc.cc.monash.edu.au>, hadgraft@vaxc.cc.monash.edu.au (Hadgraft) writes:

>One of the things I find annoying about most major Windows applications, is that
>their directories must be included in the PATH. If you use a number of them,
>your PATH gets quite long. There is such a simple solution to this problem, that
>I can't believe that so many developers don't use it. All an application has to
>do is store the home directory in WIN.INI or its own .INI file. Problem solved.
>Then my path wouldn't have to look like this:
>
>c:\windows;c:\winmisc;c:\pif;c:\winword;c:\excel3;c:\toolbook; etc
>
>......

You don't have to include their directories in the path.  Most Windows
programs don't need it (includine notepad, write, excel, w4w, ++).
You do however have to specify the full program name when You want to
start the program from program manager or indirectly from the
[Extensions] section in win.ini

Ole Nymoen
Norway

mgd@mcshh.hanse.de (Michael Gerdau) (06/11/91)

In <1991Jun6.184053.12028@cs.uoregon.edu> akm@obelix.cs.uoregon.edu (Anant Kartik Mithal) writes:

]I don't have this problem, and here is why...
]...
]In the extensions part of Win.ini, I have the following:

]doc=d:\winword\winword.exe
]xl?=d:\excel\excel.exe

]I also have usher set up to run excel and winword with the complete
]path name defined. As a result, if I run either from my shell (usher),
]the full path info is available, so I don't have a problem. If I
]double click on an icon, then windows knows the full path, so that
]isn't a problem either.

What about DDE ? If you have to enter the full pathname all the time,
that can't be considered powercomputing.
BTW, mine would be c:\windows\winword\winword.exe and
c:\windows\xl\excel.exe 'cause I hate having lots of entries in my
root dir.
Regards
Michael

-- 
Michael Gerdau, Nibelungenweg 6, W-2000 Hamburg 56, FRG  Voice: +49 40 812 164
Net: mgd@mcshh.hanse.de                   Bang: ...uunet!mcsun!unido!mcshh!mgd

hadgraft@vaxc.cc.monash.edu.au (Hadgraft) (06/11/91)

>
> I don't have this problem, and here is why...
>
> I'll try and describe my setup with Excel and Winword as examples.
> Some directory info:
>
> Windows       d:\windows
> Winword               d:\winword
> Excel         e:\excel
>
> Note that this does not include either winword or excel
>
> On the other hand, I do have a problem with memacs, which insists on
> being in the path, and grumbles about not being able to find its
> various .cmd files if it isn't in the path.
>
Yes. Excel and WinWord don't seem to need to be in the PATH, but others do.
GUIDE (hypertext), for example, can't find its files unless it's in the PATH.
Why can't they be sensible like Excel etc? What is also annoying is that the
manuals for these packages do not make it clear whether the package REALLY needs
to be on the PATH or not.

I'm convinced that the developers of these packages think that everyone only
uses one or two packages.
--
  +--------------------------------------+
  |  Roger Hadgraft                 +----------------------------------+
  |  Senior Lecturer                |  hadgraft@civeng.monash.edu.au   |
  |  Dept of Civil Engineering      |  phone:  +61 3 565 4983          |
  |  Monash University              |  fax:    +61 3 565 4944 or 3409  |
  |  Clayton, Vic. 3168. Australia. +----------------------------------+
  +--------------------------------------+

coffman@plains.NoDak.edu (Clark Coffman) (06/12/91)

In article <1991Jun6.095516.86840@vaxc.cc.monash.edu.au>
hadgraft@vaxc.cc.monash.edu.au (Hadgraft) writes:
[One of the things I find annoying about most major Windows applications,
is that [their directories must be included in the PATH. If you use a number
of them, [your PATH gets quite long. There is such a simple solution to this 
problem, that [I can't believe that so many developers don't use it. 
All an application has to [do is store the home directory in WIN.INI or its 
own .INI file. Problem solved. 
[....................

  You know, that would work, but I've always wondered why professional
programmers don't use argv[0] to find the path! I'm what my friends call
a sportsman programmer in C and I use argv[0] to find where my programs
have been started up (so they can find their configuration files).  Why
don't others use this?  It returns the full path, including the drive,
to where ever the user has stored your program.  I guess I'm assuming that
Pascal and other languages have a similar feature?  
  Oh well, just wondering.  I haven't tried this in windows' programming yet,
it seems to be available, is it?  Merry computing all!!

 ___________________________________________________________________
| Hey, who else would you expect to be responsible for what I say?  |
<===================================================================>__
| (Bitnet)   -- NU116215@NDSUVM1       -- coffman@plains            |..|
| (Internet) -- NU116215@VM1.NODAK.EDU -- coffman@plains.nodak.edu  |==>
| (UUCP)     -- uunet!plains!coffman                                |..|
|                                                                   |..|
|    Clark W. Coffman   --)------  Dagda Mor  ------)--   CWC       |. |
 |                                                                 |. .|
  |______:-: You Teach Best What You Most Need To Learn. :-:______|..  |
    |  .... .. .  .... .. .. .....  . .. .....  ... ....  .  .. ..... |
     |______________:-: "Richard Bach" :-:___________________________|

risto@tuura.UUCP (Risto Lankinen) (06/13/91)

ole@edb.tih.no (Ole Nymoen) writes:

>In article <1991Jun6.095516.86840@vaxc.cc.monash.edu.au>, hadgraft@vaxc.cc.monash.edu.au (Hadgraft) writes:

>>One of the things I find annoying about most major Windows applications, is 
>>that their directories must be included in the PATH. ...

>You don't have to include their directories in the path.  Most Windows
>programs don't need it (includine notepad, write, excel, w4w, ++).
>You do however have to specify the full program name when You want to
>start the program from program manager or indirectly from the
>[Extensions] section in win.ini

Hi!

True.  That done, the programs usually work; however, at least Excel has
some trouble finding its .HLP file, if there's no PATH to its directory.
It's therefore not a bad idea to copy the help files of any applications
not included in the PATH to either the Windows' directory or to one made
specifically for help files, which would then be included in the PATH .

Terveisin: Risto Lankinen
-- 
Risto Lankinen / product specialist ***************************************
Nokia Data Systems, Technology Dept *  2                              3   *
THIS SPACE INTENTIONALLY LEFT BLANK * 2 +1 is PRIME!  Now working on 2 -1 *
replies: risto@yj.data.nokia.fi     ***************************************

RBYAML@ROHVM1.BITNET (Aengus Lawlor) (06/14/91)

In article <10816@plains.NoDak.edu>, coffman@plains.NoDak.edu (Clark Coffman)
says:
>
>  You know, that would work, but I've always wondered why professional
>programmers don't use argv[0] to find the path! I'm what my friends call
>a sportsman programmer in C and I use argv[0] to find where my programs
>have been started up (so they can find their configuration files).  Why
>don't others use this?  It returns the full path, including the drive,
>to where ever the user has stored your program.  I guess I'm assuming that
>Pascal and other languages have a similar feature?
>
Mainly because earlier versions of DOS (2.x, and possibly 3.0 ?) didn't return
argv[0]. Some people are still running those versions.

--
RBYAML@ROHMHAAS.COM                    Aengus Lawlor
RBYAML@ROHVM1.BITNET                   (who used to be ALAWLOR@DIT.IE)
"How about some of that famous Dublin wit, Barman?"
"Certainly, sir. Would that be Dry or Sparkling?"

hadgraft@vaxc.cc.monash.edu.au (Hadgraft) (06/14/91)

In article <hn6lhp085C@humpty.edb.tih.no>, ole@edb.tih.no (Ole Nymoen) writes:
> In article <1991Jun6.095516.86840@vaxc.cc.monash.edu.au>, hadgraft@vaxc.cc.monash.edu.au (Hadgraft) writes:
>
>>One of the things I find annoying about most major Windows applications, is that
>>their directories must be included in the PATH. If you use a number of them,
>
> You don't have to include their directories in the path.  Most Windows

Let's say SOME, eg. winword and excel, as has been pointed out already. Others,
eg. GUIDE, must be in the PATH.

> programs don't need it (includine notepad, write, excel, w4w, ++).
> You do however have to specify the full program name when You want to
> start the program from program manager or indirectly from the
> [Extensions] section in win.ini

Actually, this is not quite correct. You can setup an icon in PM using the full
path name, and you can do the same with the [Extensions] facility in WIN.INI.
--
  +--------------------------------------+
  |  Roger Hadgraft                 +----------------------------------+
  |  Senior Lecturer                |  hadgraft@civeng.monash.edu.au   |
  |  Dept of Civil Engineering      |  phone:  +61 3 565 4983          |
  |  Monash University              |  fax:    +61 3 565 4944 or 3409  |
  |  Clayton, Vic. 3168. Australia. +----------------------------------+
  +--------------------------------------+

mikel@dosbears.UUCP (Mike Lipsie) (06/14/91)

In article <10816@plains.NoDak.edu> coffman@plains.NoDak.edu (Clark Coffman) writes:
> [store "home directory" for program in win.ini]
>
>  You know, that would work, but I've always wondered why professional
>programmers don't use argv[0] to find the path! I'm what my friends call
>a sportsman programmer in C and I use argv[0] to find where my programs
>have been started up (so they can find their configuration files).  Why
>don't others use this?  It returns the full path, including the drive,
>to where ever the user has stored your program.  I guess I'm assuming that
>Pascal and other languages have a similar feature?  

It is not a language (C, Pascal, ...) feature.  It is a DOS feature.
In versions of DOS before 3.0, argv[0] is the null string.

If you are writing a piece of code that will run on the most machines
possible ...

Hey!  I bet that there are still machines running DOS 1.x.  (I think I
still have a copy somewhere arounf here.)


--
Mike Lipsie
dosbears!mikel@pyramid.com
mikel%dosbears.uucp@ingres.com

hadgraft@vaxc.cc.monash.edu.au (Hadgraft) (06/17/91)

In article <465@dosbears>, mikel@dosbears.UUCP (Mike Lipsie) writes:
> In article <10816@plains.NoDak.edu> coffman@plains.NoDak.edu (Clark Coffman) writes:

>>  You know, that would work, but I've always wondered why professional
>>programmers don't use argv[0] to find the path! I'm what my friends call

> It is not a language (C, Pascal, ...) feature.  It is a DOS feature.
> In versions of DOS before 3.0, argv[0] is the null string.
>
> If you are writing a piece of code that will run on the most machines
> possible ...
>
Who gives a stuff about DOS 2? Windows 3 won't run on it, and that's the point
of the discussion.
--
  +--------------------------------------+
  |  Roger Hadgraft                 +----------------------------------+
  |  Senior Lecturer                |  hadgraft@civeng.monash.edu.au   |
  |  Dept of Civil Engineering      |  phone:  +61 3 565 4983          |
  |  Monash University              |  fax:    +61 3 565 4944 or 3409  |
  |  Clayton, Vic. 3168. Australia. +----------------------------------+
  +--------------------------------------+

mroussel@alchemy.chem.utoronto.ca (Marc Roussel) (06/18/91)

In article <10816@plains.NoDak.edu> coffman@plains.NoDak.edu (Clark Coffman)
writes:
>>  You know, that would work, but I've always wondered why professional
>>programmers don't use argv[0] to find the path! I'm what my friends call
>>a sportsman programmer in C and I use argv[0] to find where my programs
>>have been started up (so they can find their configuration files).

     I'm surprised that no one else has yet mentioned the main reason
not to use argv[0] to get the path: it isn't portable.  If your program
will never run on anything but DOS, then maybe it's a good idea.  (For
all I know there are lots of other reasons why it's not even a good idea
in DOS.)  On the other hand, at least under Unix, argv[0] isn't guaranteed to
return anything but the name the program was called under from the command
line.  It could include the path too, but it doesn't have to; argv[0]
just returns whatever the user typed.  If the user typed `foo -r bar`,
(and foo was in the PATH) argv[0] just gives 'foo'.  Given this
behaviour, it strikes that relying on argv[0] to return anything
sensible is a bad habit to get into.

				Marc R. Roussel
                                mroussel@alchemy.chem.utoronto.ca

hugh@slee01.srl.ford.com (Hugh Fader) (06/19/91)

mroussel@alchemy.chem.utoronto.ca (Marc Roussel) writes:
>      I'm surprised that no one else has yet mentioned the main reason
> not to use argv[0] to get the path: it isn't portable.  If your program
> will never run on anything but DOS, then maybe it's a good idea.  (For

We _are_ talking about programs that will never run on anything but
DOS -- Windows programs. If we were talking about a non-windows
program, the C pre-processor could be used to conditionally compile
the code that uses argv[0].
--
Hugh Fader
hugh@slee01.srl.ford.com

tomr@dbase.a-t.com (Tom Rombouts) (06/21/91)

In article <43977@fmsrl7.UUCP> hugh@slee01.srl.ford.com (Hugh Fader) writes:
>mroussel@alchemy.chem.utoronto.ca (Marc Roussel) writes:
>>      I'm surprised that no one else has yet mentioned the main reason
>> not to use argv[0] to get the path: it isn't portable.  If your program
>> will never run on anything but DOS, then maybe it's a good idea.  (For
>
>We _are_ talking about programs that will never run on anything but
>DOS -- Windows programs. 
   [ rest deleted ]

Based on some recent comments in the PC press, I don't
know about this.  Also, aren't I correct that either OS/2 2.0
or else a future MS OS/2 will be able to run Windows apps natively?
(And thus use the OS/2 HPFS file system instead of DOS underneath?)  

I think this could be a good area for discussion - things to think
about when writing Windows apps that may someday be on other
CPU/OS configurations.

Or will they be less portable (in reality) than I think?


Tom Rombouts  Torrance 'Tater  tomr@ashtate.A-T.com