Bug report #5151

OSGEO4W_ROOT not set correctly in Windows 2000

Added by Steve Hartley over 12 years ago. Updated over 12 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Build/Install
Affected QGIS version:1.7.4 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:upstream
Crashes QGIS or corrupts data:No Copied to github as #:14903

Description

Installing 1.7.4 using the standalone puts the .dll files into C:\\Program Files\\QuantumGISWroclaw\\bin but the program expects them in C:\\Program Files\\QuantumGISWroclaw\\apps\\qgis\\bin. I tried copying them across but the GUI didn't appear after the startup picture closed.
Installing 1.7.4 using the OSGeo4W Installer puts qgis.exe in C:\\OSGeo4W\\apps\\qgis\\bin but the batch (opening the shortcut) expexts it in C:\\OSGeo4W\\bin\\apps\\qgis\\bin. Opening qgis.exe from within its directory reveals that the .dll files are again not where expected and the prog fails to open.

o4w_env.bat (310 Bytes) Steve Hartley, 2012-06-07 07:56 AM

sqlite_error.bmp - sqlite error (2.25 MB) Nebojša Tanasković, 2012-06-08 12:40 AM


Related issues

Duplicated by QGIS Application - Bug report #5757: qgis 1.7.4 won't work on windows 2000 Closed 2012-06-07

History

#1 Updated by Jürgen Fischer over 12 years ago

  • Crashes QGIS or corrupts data changed from Yes to No
  • Status changed from Open to Feedback
  • Priority changed from 6 to Normal

The standalone installer is based on the OSGeo4W packages, so the file layout is the same. QGIS is started with the batch file in bin, starting the qgis.exe directly isn't supported.

I can't reproduce the problem that the batch file (which is created from qgis.bat.tmpl on install) expects qgis.exe in anything else but apps\\qgis\\bin.

#2 Updated by Steve Hartley over 12 years ago

qgis.bat (in C:\\OSGeo4W\\bin) sets the root dir to C:\\OSGeo4W, but then calls o4w_env.bat (also in C:\\OSGeo4W\\bin) which resets the root dir to the current dir (C:\\OSGeo4W\\bin). Hence thereafter when qgis.bat calls OSGEO4W_ROOT\\apps\\qgis\\bin it tries to reach C:\\OSGeo4W\\bin\\apps\\qgis\\bin, which doesn't exist. qgis.exe is then expected in the non-existent bin\\apps\\qgis\\bin, not in apps\\qgis\\bin. I tried remarking out the line calling o4w_env.bat, but that leads to the dll files being expected in apps\\qgis\\bin, when most of them have been installed in \\bin

#3 Updated by Steve Hartley over 12 years ago

Forgot to say, I now get the same problem installing trunk, but haven't had this problem installing previous (1.7.3 & before) versions, or indeed installing previous versions of trunk in the past.

#4 Updated by Jürgen Fischer over 12 years ago

Steve Hartley wrote:

qgis.bat (in C:\\OSGeo4W\\bin) sets the root dir to C:\\OSGeo4W, but then calls o4w_env.bat (also in C:\\OSGeo4W\\bin) which resets the root dir to the current dir (C:\\OSGeo4W\\bin).

Here o4w_env.bat reads

...
pushd %~dp0\\..
set OSGEO4W_ROOT=%cd%
...

which sets OSGEO4W_ROOT to the directory above bin - which is correct. When you start the OSGeo4W Shell it should even echo "OSGeo4W home is C:\\OSGeo4W". What output do you get?

#5 Updated by Steve Hartley over 12 years ago

Sorry - my programming ignorance. I thought cd meant the current dir.
When I open qgis.bat I get the echo:

OSGEO4W home is C:\\OSGeo4W\\bin
The system cannot find the path specified

and a windows error screen C:|OSGeo4W\\bin\\apps\\qgis\\bin\\qgis.exe with

Cannot find the file 'C:\\OSGeo4W\\bin\\apps\\qgis\\bin\\qgis.exe' (or one of its
components). Make sure the path & filename are correct & that all required
libraries are available.

not surprising since C:\\OSGeo4W\\bin contains a folder \\gdalplugins and a lot of .dll, .py, .bat & .exe files, but no \\apps folder.
qgis.exe has been installed in C:\\OSGeo4W\\apps\\qgis\\bin\\qgis.exe, so the installed folder & file structure doesn't match the expected one.

#6 Updated by Jürgen Fischer over 12 years ago

Steve Hartley wrote:

Sorry - my programming ignorance. I thought cd meant the current dir.
When I open qgis.bat I get the echo:

OSGEO4W home is C:\\OSGeo4W\\bin
The system cannot find the path specified

Then Windows 2000's cmd.exe apparently doesn't understand pushd %~dp0\\... Replacing

pushd %~dp0\\..
set OSGEO4W_ROOT=%cd

with

pushd %~dp0
cd ..
set OSGEO4W_ROOT=%cd%

might help. Not sure if OSGeo4W bothers to fix that, Windows 2000 is ooold.

#7 Updated by Jürgen Fischer over 12 years ago

  • Subject changed from Installation of 1.7.4 puts files in wrong directories to OSGEO4W_ROOT not set correctly in Windows 2000

#8 Updated by Steve Hartley over 12 years ago

Success! Your suggestion works. Thank you for helping me to continue to run the very very ancient Windows 2000.

#9 Updated by Jürgen Fischer over 12 years ago

  • Status changed from Feedback to Closed
  • Resolution set to upstream

#10 Updated by Nebojša Tanasković over 12 years ago

Can you upload your qgis.bat which works, please

#11 Updated by Steve Hartley over 12 years ago

I had to modify o4w_env.bat (attached) in C:\\OSGeo4W\\bin, not qgis.bat

#12 Updated by Nebojša Tanasković over 12 years ago

next error- see attachment

The procedure entry point sqlite3_open_v2 could not be located in dynamic kink library sqlite3.dll

????

#13 Updated by Jürgen Fischer over 12 years ago

see also OSGeo4W #276

Current OSGeo4W should already contain the modified batch file.

Also available in: Atom PDF