Opened 15 years ago

Closed 12 years ago

#36 closed defect (fixed)

change app launch bat files to call o4w_env.bat

Reported by: maphew Owned by: maphew
Priority: major Component: Package
Version: Keywords:
Cc:

Description (last modified by maphew)

Go through all the packages and change

PATH=%OSGEO4W_ROOT%\bin;%PATH%
for %%f in ("%OSGEO4W_ROOT%"\etc\ini\*.bat) do call "%%f"

to

call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
start "Foo title" /B "%OSGEO4W_ROOT%\bin\foo.exe" %*

Change History (5)

comment:2 by jef, 15 years ago

start /b "%OSGEO4W_ROOT%\bin\foo.exe" didn't work for me.

Looks like cmd misinterprets the quoted argument as window title. In the QGIS package I therefore use:

@echo off

SET OSGEO4W_ROOT=@osgeo4w@
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
@echo off
call "%OSGEO4W_ROOT%"\bin\gdal16.bat

start "Quantum GIS" /B "%OSGEO4W_ROOT%"\bin\qgis.exe %*

The GRASS package now also uses o4w_env.bat

comment:3 by maphew, 15 years ago

Thank you for catching that jef, I've corrected that instructions accordingly.

comment:4 by maphew, 12 years ago

Description: modified (diff)

comment:5 by maphew, 12 years ago

Resolution: fixed
Status: assignedclosed

Closing ticket. This is best handled by updating the Packaging Instructions # batch file template with the recommended approach (done) and letting the maintainers adjust as suits them.

Also a tweak to the original suggestion to avoid hard coding osgeo4w_root: If bin\foo.bat use:

@echo off
call "%~dp0\o4w_env.bat"
start "Foo window title" /B "%OSGEO4W_ROOT%\bin\foo.exe" %*
@echo on

If apps\foo\foo.bat use:

@echo off
call "~dp0\..\..\bin\o4w_env.bat
start "Foo window title" /B "%OSGEO4W_ROOT%\apps\foo\foo.exe" %*
@echo on
Note: See TracTickets for help on using tickets.