2 # ======================================================#
3 # File automagically generated by GUI2Exe version 0.3
4 # Andrea Gavana, 01 April 2007
5 # ======================================================#
7 # Let's start with some default (for me) imports...
9 from distutils.core import setup
16 from distutils.core import setup
19 # Overriding Criteria for Including DLLs, see:
20 # http://www.py2exe.org/index.cgi/OverridingCriteraForIncludingDlls
21 # XXX: Check the permission to redistribute msvcp71.dll
22 origIsSystemDLL = py2exe.build_exe.isSystemDLL
23 def isSystemDLL(pathname):
24 if os.path.basename(pathname).lower() in ("msvcp71.dll",):
26 return origIsSystemDLL(pathname)
27 py2exe.build_exe.isSystemDLL = isSystemDLL
30 # Remove the build folder
31 shutil.rmtree("build", ignore_errors=True)
34 manifest_template = """
35 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
36 <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
39 processorArchitecture="x86"
43 <description>gpdf2swf Program</description>
48 name="Microsoft.Windows.Common-Controls"
50 processorArchitecture="X86"
51 publicKeyToken="6595b64144ccf1df"
60 """ A simple class that holds information on our executable file. """
61 def __init__(self, **kw):
62 """ Default class constructor. Update as you need. """
63 self.__dict__.update(kw)
66 # Ok, let's explain why I am doing that.
67 # Often, data_files, excludes and dll_excludes (but also resources)
68 # can be very long list of things, and this will clutter too much
69 # the setup call at the end of this file. So, I put all the big lists
70 # here and I wrap them using the textwrap module.
72 data_files = [('viewers', ['viewers/__init__.py',
77 'viewers/simple.py']),
78 #('.', ['dll/msvcp71.dll',
80 #('images', ['images/stop.png',
81 # 'images/pdf2swf_gui.ico'])
85 excludes = ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'email', 'pywin.debugger',
86 'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',
87 'Tkconstants', 'Tkinter']
88 packages = ['viewers']
89 dll_excludes = ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', 'tcl84.dll',
91 icon_resources = [(1, 'gpdf2swf.ico')]
93 other_resources = [(24, 1, manifest_template)]
96 # This is a place where the user custom code may go. You can do almost
97 # whatever you want, even modify the data_files, includes and friends
98 # here as long as they have the same variable name that the setup call
101 # No custom code added
104 # Ok, now we are going to build our target class.
105 # I chose this building strategy as it works perfectly for me :-D
108 GUI2Exe_Target_1 = Target(
110 script = "gpdf2swf.py",
111 icon_resources = icon_resources,
112 bitmap_resources = bitmap_resources,
113 other_resources = other_resources,
114 dest_base = "gpdf2swf",
116 company_name = "swftools",
117 copyright = "swftools",
123 # That's serious now: we have all (or almost all) the options py2exe
124 # supports. I put them all even if some of them are usually defaulted
125 # and not used. Some of them I didn't even know about.
129 data_files = data_files,
131 options = {"py2exe": {"compressed": 0,
133 "includes": includes,
134 "excludes": excludes,
135 "packages": packages,
136 "dll_excludes": dll_excludes,
140 "skip_archive": False,
142 "custom_boot_script": '',
148 windows = [GUI2Exe_Target_1]
151 # This is a place where any post-compile code may go.
152 # You can add as much code as you want, which can be used, for example,
153 # to clean up your folders or to do some particular post-compilation
156 # No post-compilation code added
159 # And we are done. That's a setup script :-D
161 # Run setup standalone...
162 if __name__ == "__main__":