--- /dev/null
+# This is a DistUtils setup script to be used with py2exe, a DistUtils extension.
+#
+# To create the redistributable package, run:
+# python setup.py py2exe
+#
+# You may need to change the following line to accurately show the location of
+# your PyQt4 plugins folder:
+plugins_base = "C:\\Python26\\Lib\\site-packages\\PyQt4\\plugins"
+
+from py2exe.build_exe import py2exe
+from distutils.core import setup
+import os
+
+# We need the sqlite3 SQL driver, implemented as a plugin
+sqldrivers_files = [plugins_base + "\\sqldrivers\\qsqlite4.dll"]
+
+# We need the JPG image format plugin, but we might as well grab them all
+imageformats_files = []
+image_base = plugins_base + "\\imageformats\\"
+for f in os.listdir(image_base):
+ p = image_base + f
+ if os.path.isfile(p): # skip directories
+ imageformats_files.append(p)
+
+# Invoke the distutils setup command with appropriate options
+setup(
+ options = {
+ "py2exe": {
+ # 1 or 2 (packing libs into the .exe) seem to have massive issues with image format plugin loading
+ "bundle_files": 3,
+ # We declare these here, otherwise they don't get pulled in (and are needed at runtime)
+ "includes": ["sip","PyQt4.QtSql"]
+ }
+ },
+ console = [{"script": "mainapp.py"}],
+ zipfile = None,
+ data_files = [
+ ("", ["README","LICENSE"]),
+ ("sqldrivers", sqldrivers_files),
+ ("imageformats", imageformats_files)
+ ]
+)
+