[osgeo4w-dev] PATH ordering for OSGeo4W Shell

Mike Toews mwtoews at gmail.com
Tue Jul 17 00:19:16 PDT 2012

Hi all,

I have some commercial third-party software installed on my computer
that installed an older version of GDAL, including utilities, in it's
own directory structure. This software also appended it's paths to the
system PATH (done by the installer, not by my choice), so I could open
any cmd.exe and type "gdalinfo --version" to see "GDAL 1.7.0dev,
FWTools 2.4.4, released 2009/09/23".

However, from an OSGeo4W Shell, I'd rather be using the OSGeo4W
version of GDAL, but I'm not. Here's what I see from OSGeo4W Shell:
C:\>gdalinfo --version
GDAL 1.7.0dev, FWTools 2.4.4, released 2009/09/23

C:\>where gdalinfo

C:\>c:\gnu\OSGeo4W\bin\gdalinfo.exe --version
GDAL 1.9.1, released 2012/05/15

Files (x86)\Java\jre6\bin;C:\gnu\OSGeo4W\bin;C:\gnu\OSGeo4W\\apps\msys\bin;C:\gnu\OSGeo4W\\apps\Python27\Scripts

Why isn't gdalinfo.exe from OSGeo4W not used in preference over the
other one installed in C:\GWV6\gdal\bin? Here it looks like PATH has
been modified by OSGeo4W to append two paths.

With the MSYS shell distributed with OSGeo4W, things look better:

$ which gdalinfo

$ gdalinfo --version
GDAL 1.9.1, released 2012/05/15

$ echo $PATH
Files (x86)/Java/jre6/bin:/bin:/osgeo4w/apps/Python27/Scripts

Why is the PATH variable set with MSYS inserting some paths at the
front, and appending others at the end? Should both shells be
inserting the paths at the beginning of the PATH environment?


More information about the osgeo4w-dev mailing list