From: Frédéric <fre...@gb...> - 2008-09-09 12:59:40
|
Hello, For my application, I use glade to build GUIs. This application runs fine under linux, and Nokia Internet Tablet for which it is first designed. It also works under windows, so I would like to package it using py2exe. With the help of Mario (don't know if he is on this list), I was able to write a special setup.py for that purpose. We also started to write a NIS script to distribute the software. But I have some troubles for non-python files, especially for glade files. Here is my source structure: papywiz.py setup.py papywizard/ papywizard/common/ papywizard/common/loggingServices.py papywizard/common/papywizard.conf papywizard/common/... papywizard/view/ papywizard/view/mainWindow.glade papywizard/view/shootDialog.glade papywizard/view/... papywizard/controller/ papywizard/controller/mainController.py papywizard/controller/shootController.py papywizard/controller/... papywizard/... Once py2exe and NIS script are run, I get the following 'Program Files' structure: C:\Program Files\papywizard\papywiz.exe C:\Program Files\papywizard\Library.zip C:\Program Files\papywizard\w9popen.exe C:\Program Files\papywizard\uninstall.exe C:\Program Files\papywizard\... C:\Program Files\papywizard\papywizard/ C:\Program Files\papywizard\papywizard/common/ C:\Program Files\papywizard\papywizard/common/papywizard.conf C:\Program Files\papywizard\papywizard/common/... C:\Program Files\papywizard\papywizard/view/ C:\Program Files\papywizard\papywizard/view/mainWindow.glade C:\Program Files\papywizard\papywizard/view/shootDialog.glade C:\Program Files\papywizard\papywizard/view/... C:\Program Files\papywizard\papywizard/controller/ C:\Program Files\papywizard\papywizard/controller/mainController.py C:\Program Files\papywizard\papywizard/controller/... C:\Program Files\papywizard\... it seems that the Library.zip archive can only contains pure python modules (those build in collect-2.5/). So, I added non-python files using data_files params in the setup. the problem is that I don't know how to retreive these files... In my controllers code, which load the glade files to build the GUI, I use the following statement: path = os.path.dirname(__file__) gladeFile = os.path.join(path, os.path.pardir, "view", gladeFile) self.wTree = gtk.glade.XML(gladeFile) to retreive the glade file (and similar statement for the papywizard.conf file). But under windows, once the package is installed, python search in: C:\Program Files\papywizard\Library.zip\papywizard\common\view instead of: C:\Program Files\papywizard\papywizard\common\view so, glade and conf files can't be found. Is there a way to add these files in Library.zip (i.e. in collect-2.5/ dir)? Thanks for you help, PS: There are maybe solutions to search the glade files in C:\Program Files\papywizard\papywizard\common\view dir, but I don't want a windows-specific code, as this software must work under linux too. That's why I prefer to work on the installer side (if possible). -- Frédéric |