From: Kevin A. <al...@se...> - 2002-01-14 19:15:19
|
I started playing with version 5 of Gordon McMillan's installer over the weekend. I have a working .spec file which I've included below and checked into cvs for the minimal sample. I have not tested it on Linux, but it builds standalone on Windows just fine. I've exchanged some emails with Gordon about adding lines to the spec to exclude PIL and tkinter from the build. Apparently, the next version of the installer will have support for excluding packages. Once I figure out the necessary exclusion lines for the spec file I'll update cvs and reply to this thread. In the meantime, if you want to exclude PIL/tkinter you can modify the graphic.py module in the PythonCardPrototype directory to PIL isn't imported. Just comment out the try/except block and add PIL_FOUND = 0 like so: """ try: import Image # necessary to avoid name collision with Image class from Image import fromstring PIL_FOUND = 1 except ImportError: PIL_FOUND = 0 """ PIL_FOUND = 0 As with py2exe you'll need to uncomment the import line in minimal.py. The results of the build are placed in the distminimal directory. ka --- """ A spec file to make a standalone of minimal for Windows and Linux platforms. You can get Gordon McMillans installer from http://www.mcmillan-inc.com/install1.html Use this command to build the standalone and collect the other needed files: Build.py minimal.spec """ a = Analysis(['minimal.py'], pathex=[]) pyz = PYZ(a.pure) exe = EXE(pyz, a.scripts, exclude_binaries=1, name='buildminimal/minimal.exe', debug=0, console=1) coll = COLLECT( exe, a.binaries + \ [('minimal.rsrc.py', 'minimal.rsrc.py', 'DATA')] + \ [('readme.txt', 'readme.txt', 'DATA')], name='distminimal') |