diff --git a/lightningbeam.py b/lightningbeam.py index 0afd4a7..12b368b 100755 --- a/lightningbeam.py +++ b/lightningbeam.py @@ -327,7 +327,17 @@ def run_file(self=None): print "RUNNING" root.descendItem().activelayer.frames[root.descendItem().activelayer.currentframe].actions = MainWindow.scriptwindow.text open(os.getenv('HOME')+"/test.sc", "w").write(create_sc(root)) - svlgui.execute("swfc/swfc_"+svlgui.PLATFORM+" "+os.getenv('HOME')+"/test.sc -o "+os.getenv('HOME')+"/test.swf") + # svlgui.execute("swfc/swfc_"+svlgui.PLATFORM+" "+os.getenv('HOME')+"/test.sc -o "+os.getenv('HOME')+"/test.swf") + x = os.system("swfc/swfc_"+svlgui.PLATFORM+" "+os.getenv('HOME')+"/test.sc -o "+os.getenv('HOME')+"/test.swf") + if sys.version_info < (2, 6): + if x==5: # which is the error value returned when linking libjpeg fails + if svlgui.alert("You appear to be missing libjpeg. Install it?", confirm=True) + os.system("""osascript -e 'do shell script "mkdir -p /usr/local/lib; cp swfc/libjpeg.8.dylib /usr/local/lib" with administrator privileges'""") + x = os.system("swfc/swfc_"+svlgui.PLATFORM+" "+os.getenv('HOME')+"/test.sc -o "+os.getenv('HOME')+"/test.swf") + if x==5: + svlgui.alert("Sorry, something has gone terribly wrong.") + else: + return #TODO: Make this cross-platform compatible if svlgui.PLATFORM=="win32": # Untested. @@ -349,7 +359,11 @@ def run_file(self=None): return else: svlgui.alert("The Flash Debugger will download when you click Ok.\nThis may take some time.") - urllib.urlretrieve("http://fpdownload.macromedia.com/pub/flashplayer/updaters/11/flashplayer_11_sa_debug.app.zip", "fp.app.zip") + if sys.version_info < (2, 6): + # Newer flash players won't run on Leopard + urllib.urlretrieve("http://download.macromedia.com/pub/flashplayer/updaters/10/flashplayer_10_sa_debug.app.zip", "fp.app.zip") + else: + urllib.urlretrieve("http://fpdownload.macromedia.com/pub/flashplayer/updaters/11/flashplayer_11_sa_debug.app.zip", "fp.app.zip") # Unzip the file. Apparently ditto is better for OSX apps than unzip. os.system('ditto -V -x -k --sequesterRsrc --rsrc fp.app.zip .') shutil.move('Flash Player Debugger.app', '/Applications/Flash Player Debugger.app') diff --git a/swfc/libjpeg.8.dylib b/swfc/libjpeg.8.dylib new file mode 100755 index 0000000..e637fcc Binary files /dev/null and b/swfc/libjpeg.8.dylib differ diff --git a/swfc/swfc_osx b/swfc/swfc_osx index 5833dde..f59234e 100755 Binary files a/swfc/swfc_osx and b/swfc/swfc_osx differ