build AppBundler?

Marco Dinacci marco.dinacci at gmail.com
Fri May 11 06:18:06 PDT 2012


Hi,

>> However I've found one problems after building my app using the latest
>> code, the icon is not showing.
>>
>> The reason is that in main.m you changed the current directory to
>> NSHomeDirectory before launching the application
>
> This is probably a red herring. The working directory shouldn't have any effect on the icon - if it did, any app that changed the working directory to something other than the bundle root at startup would break.
>
> There does seem to be a problem with the icon and app title, though. For some reason, the icon starts correctly but then quickly changes to the default Java icon. I'm looking into it now.

As Tobias wrote you have to manually add the -Xdock:icon option in the
build.xml since all the appbundler do at the moment is copying the
icon in the bundle, without adding the aforementioned option.

So if you chdir to the user home before launching the program you'll
pass the wrong icon path (ex. ../Resources/MyIcon.icns) to the
application.

Maybe an alternative solution that doesn't involve changing the path
to the bundle could be to parse the java options before launching the
app and if the -Xdock:icon is present adjust the path accordingly.


Marco


More information about the macosx-port-dev mailing list