py2exe, Inno Setup, and tkinter

Brian Kelley bkelley at wi.mit.edu
Mon Jan 12 18:00:31 CET 2004


Anthony Baxter wrote:
> I'm trying to use py2exe and Inno Setup to build an installer for 
> shtoom, which uses tkinter.
> 
> If I take the py2exe generated directory, and run the executable from
> there, it works fine.
> 
> If I add all the files in the directory to an installer (including 
> the tk-8.4 and tcl-8.4 directories), it builds an installer fine.

I have a script for creating innosetup's [FILE] section.  I have used 
this just fine so it fails for you it may indicate a problem with tcl/tk 
on your *normal* installation.  Can you run your program outside of py2exe?

Here is the script:

import os
# This script creates the [FILES] section for innosetup
# I use it for creating the installer for py2exe
# generated distributions.  Mainly because adding the
# tcl/tk stuff is a royal pain.

# Point FROM_DIRECTORY to py2exe's destination directory
# This will include all tcl/tk and wxPython files and
# everything else in the directory and subdirectories.

FROM_DIRECTORY = r"C:\Users\kelley\Working\PlateReader\app\dist\Vista"

os.chdir(FROM_DIRECTORY)
def innoSourceLine(source, dest):
     return 'Source: "%s"; DestDir: "{app}\%s"; CopyMode: 
alwaysoverwrite'%(source, dest)

for root, dirs, files in os.walk("."):
     sourcedir = os.path.abspath(root)
     for f in files:
         # get the destination directory
         source = os.path.join(sourcedir, f)
         dest = root
         print innoSourceLine(source, dest)


# Brian




More information about the Python-list mailing list