On Jun 15, 10:31 pm, Yarko Tymciurak <resultsinsoftw...@gmail.com> wrote: > On Jun 15, 10:26 pm, Salvor Hardin <salvor.pub...@gmail.com> wrote: > > > I got an unexpected result. > > > C:\Python25\python.exe loads C:\Python25\Dlls\sqlite3.dll when I issue > > "import sqlite3" > > > And, C:\web2py\web2py.exe loads C:\Windows\system32\sqlite3.dll > > immediately (before pressing Start Server button.) > > If that is the case, then the dynamic load order may be an artifact of > whoever ran py2exe to generate the web2py.exe (in other words, _their_ > system is the problem, and it propogated to you). > > But the good news - if you're python pulls in the correct sqlite --- > is you will be all set if you just use the source version of web2py. > > In the meantime, we can let Massimo sort through / ask more questions > as he needs to fix web2py.exe generation. > > - Yarko >
On Windows XP SP1 and newer, web2py.exe can call SetDllDirectory(path) -- but it requires defining _WIN32_WINNT as 0x0502. It'll make web2py apps more reliable/predictable on Windows but users still running Windows 2000 will need to run from source version. "After calling SetDllDirectory, the DLL search path is: 1. The directory from which the application loaded. 2. The directory specified by the lpPathName parameter. 3. The system directory. [e.g. often C:\Windows\System32] 4. The 16-bit system directory. [e.g. often C:\Windows\System] 5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory. 6. The directories that are listed in the PATH environment variable. To revert to the default search path used by LoadLibrary and LoadLibraryEx, call SetDllDirectory with NULL. This also restores safe DLL search mode based on the SafeDllSearchMode registry value. To compile an application that uses this function, define _WIN32_WINNT as 0x0502 or later." Source: http://msdn.microsoft.com/en-us/library/ms686203(v=VS.85).aspx