[PostGIS] #5689: Set PostGIS windows bundle environment for service rather than machine.

PostGIS trac at osgeo.org
Thu Mar 7 14:02:29 PST 2024


#5689: Set PostGIS windows bundle environment for service rather than machine.
--------------------------+-------------------------------
  Reporter:  slefranc     |      Owner:  strk
      Type:  enhancement  |     Status:  new
  Priority:  medium       |  Milestone:  PostGIS Packaging
 Component:  install      |    Version:  3.3.x
Resolution:               |   Keywords:  windows
--------------------------+-------------------------------
Description changed by slefranc:

Old description:

> The PostGIS Windows bundle (postgis-bundle-pg15x64-setup-3.3.2-2.exe)
> asks the user if they want to set environment variables during
> installation.
>
> The environment is set at the machine level. This works for PostGIS
> itself, but can cause conflicts with other geospatial software. In our
> case, the GDAL variables (GDAL_DATA and PROJ_LIB) were conflicting with
> R's own GDAL libraries.
>
> I was able to set the environment at the service level instead:
>
> {{{
> path:
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\postgresql-x64-15
> name: Environment
> REG_MULTI_SZ:
>       GDAL_DATA=C:\Program Files\PostgreSQL\15\gdal-data
>       POSTGIS_ENABLE_OUTDB_RASTERS=1
>       POSTGIS_GDAL_ENABLED_DRIVERS=GTiff PNG JPEG GIF XYZ DTED USGSDEM
> AAIGrid
>       PROJ_LIB=C:\Program
> Files\PostgreSQL\15\share\contrib\postgis-3.3\proj
> }}}
>
> This has worked so far in our teaching lab setup, but I haven't done
> thorough testing of all PostGIS functions.
>
> Would it be possible to have the installer set the environment like this
> instead of globally, assuming it passes broader tests?

New description:

 The PostGIS Windows bundle (postgis-bundle-pg15x64-setup-3.3.2-2.exe) asks
 the user if they want to set environment variables during installation.

 The environment is set at the machine level. This works for PostGIS
 itself, but can cause conflicts with other geospatial software. In our
 case, the GDAL variables (GDAL_DATA and PROJ_LIB) were conflicting with
 R's own GDAL libraries.

 I was able to set the environment at the service level instead using the
 registry:

 {{{
 path:
 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\postgresql-x64-15
 name: Environment
 REG_MULTI_SZ:
       GDAL_DATA=C:\Program Files\PostgreSQL\15\gdal-data
       POSTGIS_ENABLE_OUTDB_RASTERS=1
       POSTGIS_GDAL_ENABLED_DRIVERS=GTiff PNG JPEG GIF XYZ DTED USGSDEM
 AAIGrid
       PROJ_LIB=C:\Program
 Files\PostgreSQL\15\share\contrib\postgis-3.3\proj
 }}}

 This has worked so far in our teaching lab setup, but I haven't done
 thorough testing of all PostGIS functions.

 Would it be possible to have the installer set the environment like this
 instead of globally, assuming it passes broader tests?

--
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5689#comment:1>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list