cairo dependency after installation

I am using py2exe to create packages and inno setup to create
installers. When you are using cairo with wxPython,
py2exe correctly finds three dlls(libcairo-2.dll, libpng12-0.dll &
zlib1.dll) and include them in library.zip.

Once you installed the app on a user machine, app crashes because the
function findCairoLib in wxcairo.py searches for dlls only in the
directories mentioned in PATH env var.

To solve this, I have excluded three dlls from library.zip and now
installer copies all the dlls including ms*.dll & gdiplus.dll where
you have your .exe. To test on machine which is development machine
also, I have removed three
dlls from C:\Python26\Lib\site-packages\cairo path. Executable works
but when installing on third party machine, this doesn't works and I
am not creating any environment variables when installing.

I also added this in wxcairo's findCairoLib in function prior to
ctypes.util.find_library(name)

if hasattr(sys, "frozen"):
        location = os.path.join(os.path.dirname(sys.executable),
"libcairo-2.dll")

Now what would be the safest place to copy three cairo dlls on third
party machine.

After installing on a third party machine I removed three cairo dlls
from installation directory and copied into system32 director and app
works. This creates a slight confusion between my machine(development)
and third party machine.

NOTE:

the library.zip in inside /lib directory. The directory structure
after installation is like this:

lib/
    library.zip
app.exe
ms*.dll
gdiplus.dll
libcairo-2.dll
libpng12-0.dll
zlib1.dll
.manifest
python26.dll

Prashant

I usually just leave the dlls I need in the directory that contains my
executable. You could put the cairo ones into their own folder in the
same directory or in some user folder, like c:\documents and settings
\username\application data\myAppName

···

On Mar 11, 11:49 pm, King <animator...@gmail.com> wrote:

I am using py2exe to create packages and inno setup to create
installers. When you are using cairo with wxPython,
py2exe correctly finds three dlls(libcairo-2.dll, libpng12-0.dll &
zlib1.dll) and include them in library.zip.

Once you installed the app on a user machine, app crashes because the
function findCairoLib in wxcairo.py searches for dlls only in the
directories mentioned in PATH env var.

To solve this, I have excluded three dlls from library.zip and now
installer copies all the dlls including ms*.dll & gdiplus.dll where
you have your .exe. To test on machine which is development machine
also, I have removed three
dlls from C:\Python26\Lib\site-packages\cairo path. Executable works
but when installing on third party machine, this doesn't works and I
am not creating any environment variables when installing.

I also added this in wxcairo's findCairoLib in function prior to
ctypes.util.find_library(name)

if hasattr(sys, "frozen"):
location = os.path.join(os.path.dirname(sys.executable),
"libcairo-2.dll")

Now what would be the safest place to copy three cairo dlls on third
party machine.

After installing on a third party machine I removed three cairo dlls
from installation directory and copied into system32 director and app
works. This creates a slight confusion between my machine(development)
and third party machine.

NOTE:

the library.zip in inside /lib directory. The directory structure
after installation is like this:

lib/
library.zip
app.exe
ms*.dll
gdiplus.dll
libcairo-2.dll
libpng12-0.dll
zlib1.dll
.manifest
python26.dll

Prashant

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Mike Driscoll wrote:

I usually just leave the dlls I need in the directory that contains my
executable.

So do I , but I don't like it. It's better than putting them in a system directory, though -- that way lies dll hell.

What I'd like py2exe to do is create something like:

MyApp\
     MyApp.exe
     library\
         lib\
             abc.dll
             def.dll
             ...
         code\
             something.pyc
             something_else.pyc
             a_package\
                 __init__.pyc
                 a_module
             ...
     resources\
         icon1.png
         icon2.png
         data1.dat
         ...

Details don't matter, but a clean structure, and most important, having the exe pretty much by itself were it is easy to find, and the dlls and python code, etc buried a bit. What I really want is something like an OS-X application bundle -- that really is a good idea!

But I don't know how to get Windows to find the dlls in that case...

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov