On 6/27/2009 4:32 PM, Hans-Peter Jansen wrote:
> Am Freitag, 26. Juni 2009 schrieb Hans-Peter Jansen:
>> Dear Giovanni et.al.,
>>
>> first of all - awesome work!
>>
>> I just fiddled for half an hour with PyInstaller, and got something
>> working on the Mac - even as single file, and that's me being a Mac
>> greenhorn...
>>
>> Now a few issues still stand: when I run my script.pyw by double click,
>> all is well (more or less, I really don't like the "Python Launcher"
>> redirection at all), but after a few clicks into it, no terminal is
>> opened anymore. Unlike executed as a one file image - then a terminal
>> window is opened all the time, echoing the command: /path/to/Image.app;
>> exit
>>
>> It would be nice to get the -w option of Makespec.py going for the Mac,
>> too.
>
> Okay, after more experimenting and code exploration, I found out, that you
> do honor the -w option on the Mac in some way, as noted in the ChangeLog.
> Unfortunately, no matter how I build my project, (one file or one dir,
> console=0|1), the resulting exe / dir is working fine, but opens the
> dreaded terminal window. Strangely enough, if I run it from a console
> (local or remote), then no extra terminal window is opened _nor_ is
> anything printed in that console.
>
> It looks like some finder redirection mechanisms generates some console
> output and throws that into a terminal window, but I don't understand this
> at all. Anybody from the audience?
>
> In order to get my app displaying an icon in finder, I've learned to create
> an .app folder, created Contents/Info.plist, added an icon in .icns Format
> and an empty.lproj to Contents/Resources and my app image/files into
> Contents/MacOS.
>
> While the app appears as the icon, unfortunately, it doesn't run at all.
> Double clicking on it let the icon jump for some seconds, and thats it.
> No application :-(, similar to:
> $ open -a My.app
> [blink, blink]
> $
>
> Needless to say, starting my app via console inside the .app/Contents/MacOS
> folder does work, as well as double clicking it (with the extra console
> window opened).
>
> Looks like the app needs some build option added to be created as bundle
> correctly.
>
> For the sake of completeness, I should have mentioned the versions in use:
> Mac OS-X 10.4.11 (PowerPC)
> Python 2.6.2
> Qt 4.5.1
> PyQt 4.5
> PyInstaller (current SVN)
>
> Any hints/ideas on how to get rid to this issue are greatly appreciated.
Hi Pete,
In [685], I've just committed preliminar supporto for building a bundle
(.app) on Mac OSX. Right now, only the core functionality has been
commmitted: it has yet to be integrated within Makespec.py.
To test it, add this at the bottom of your .spec file:
import sys
if sys.platform.startswith("darwin"):
app = BUNDLE(exe,
appname=name,
version=version)
It should correctly supports icons, and work in both one-file and
one-dir mode.
What I plan to do is to:
1) Make it so BUNDLE() is automatically a nop on platforms != darwin (so
to not be forced to put that "if" statement within the spec file)
2) Modify the templates in Makespec.py so that it adds a BUNDLE()
command whenever -w/--windowed is specified.
Patches are of course welcome :)
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/PyInstaller?hl=en
-~----------~----~----~----~------~----~------~--~---