[Distutils] WinNT and distutils

Thomas Heller thomas.heller@ion-tof.com
Fri, 28 Jan 2000 09:42:47 +0100


> > >Perhaps the msvccompiler.py class should take care of this too...
> > >it would sure help to avoid a distutils FAQ.
>
> I'll happily accept patches!  (I'd prefer not to be the one to translate
> a Microsoft-written batch file into Python: there're reasons I abandoned
> DOS almost 6 years ago, and batch files were one of them...)
>
> > Surely msvccompiler can tell if a particular file (say cl.exe) isn't in
> > any of the well known places.
>
> Depends what you mean by "well-known places".  If you mean
> os.environ['PATH'], then the spawn module can (and should) do a bit of
> work ahead of time to see if the expected command is really there.

On NT, there are three kinds of "well-known places":
1. on the PATH
2. in the default directory which MS suggests when installing MSVC
3. in the real directory where MSVC is installed, assumuming the default
   has not been accepted.

Only 1 is easy. Points 2 and 3 can only be retrieved by searching the
registry,
because even the default directory depends on the Windows Version:
  (english) c:\Program Files\...
  (german)  c:\Programme\...
Note that not only you have to know where to find cl.exe, you also have
to set the INCLUDE and LIB directories!

We could assume that a developer who has installed MSVC would know how
to set up the environment, but I guess this is usually not the case,
because most developers I know of simply fire up DevStudio, they never use
the command line.

> As for dreaming about searching the registry: as long as it's not
> available under Python 1.5.*, then I don't want Distutils to depend on
> it.
The conclusion is:
You can not do too much under NT when you cannot look into the registry.
(That reminds me of the 'good old times' when every program added its own
directory
to the PATH ;-)
>
>         Greg
>
Thomas Heller