From a541b86f6fdb6540f56ef5e559839ad2497960f4 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 15 Jan 2012 11:51:13 -0500 Subject: [PATCH] Now builds on Windows, mostly successfully. --- README_INSTALL.txt | 8 ++++++++ lightningbeam.py | 5 ++++- setup.py | 22 ++++++++++++++++++++-- 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 README_INSTALL.txt diff --git a/README_INSTALL.txt b/README_INSTALL.txt new file mode 100644 index 0000000..2f895d2 --- /dev/null +++ b/README_INSTALL.txt @@ -0,0 +1,8 @@ + + +Building on Windows: + 1. In a CMD window, type: + c:\Python27\python.exe setup.py py2exe + 2. Copy the GUI folder from the root directory into dist\. + 3. The executable is in dist\lightningbeam.exe. You probably do need most if the DLL's, I haven't + gone through them yet. \ No newline at end of file diff --git a/lightningbeam.py b/lightningbeam.py index 69dc2fc..f837fd0 100755 --- a/lightningbeam.py +++ b/lightningbeam.py @@ -6,7 +6,10 @@ import os #Uncomment to build on OS X -import objc, AppKit, cPickle +#import objc, AppKit, cPickle + +#Uncomment to build on Windows +import ctypes, ctypes.wintypes, win32print #SVLGUI - my custom GUI wrapper to abstract the GUI import svlgui diff --git a/setup.py b/setup.py index 86688b1..1481a1f 100644 --- a/setup.py +++ b/setup.py @@ -36,10 +36,28 @@ if sys.platform == 'darwin': )), ) elif sys.platform == 'win32': + import GUI.py2exe + import py2exe + import os + import win32ui + Mydata_files=["gpl.txt",]#"GUI",] + for files in os.listdir('media'): + f1 = 'media/' + files + if os.path.isfile(f1): # skip directories + f2 = 'media', [f1] + Mydata_files.append(f2) + for files in os.listdir('swfc'): + f1 = 'swfc/' + files + if os.path.isfile(f1): # skip directories + f2 = 'swfc', [f1] + Mydata_files.append(f2) extra_options = dict( setup_requires=['py2exe'], - app=[mainscript], - options=dict(py2app=dict(resources=["media","gpl.txt","swfc"],)), + windows=[mainscript], + other_resources=[("media",["media"]),("gpl.txt",["gpl.txt"]),("swfc",["swfc"]),("GUI",["GUI"])], + data_files=Mydata_files, + options=dict(py2exe=dict(packages=["win32ui","win32clipboard","win32api","win32gui","win32process"], + skip_archive=True,)), ) else: extra_options = dict(