Opened 5 months ago

Last modified 3 months ago

#5689 new enhancement

Set PostGIS windows bundle environment for service rather than machine. — at Version 1

Reported by: slefranc Owned by: strk
Priority: medium Milestone: PostGIS Packaging
Component: install Version: 3.4.x
Keywords: windows Cc:

Description (last modified by slefranc)

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?

Change History (1)

comment:1 by slefranc, 5 months ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.