Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-07

Mac OS X (Carbon), executable placement issue

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

John Stoneham

First of all, let me say I'm ecstatic about the progress on the native Carbon Mac OS X build. I've recently switched to Mac OS X completely (no Windows at all for me anymore), so finding Lazarus can use native Carbon widgets was like finding Christmas in July! :)

One thing that I question, though, is the decision to leave the main executable of a program outside the app bundle and using a link inside the app bundle to that executable. For example, lets say you've got a project called "Testme". In the build directory you will have both the "Testme" executable and the "Testme.app" bundle. Of course the question for the end user is "which one do I run?" since they both have the same filename (the ".app" extension is hidden in the Finder). Running the "Testme" executable from the command line doesn't work (oh, it runs, but it is inaccessible to mouse or keyboard input and must be stopped with a killall command). Running "Testme.app" does work fine (when using "open Testme.app" at the command line or double-clicking on it from the Finder). But leaving the main executable outside the bundle is non-standard and could cause problems for the end user, e.g. when double-clicking on the "Testme" executable instead of "Testme.app" since the ".app" is hidden in the finder. And it will look to the end user like there are two programs (or at least two files) with the same name. Instead of this approach, the "Testme" executable should be placed inside the "Testme.app" bundle at "Testme.app/Contents/MacOS/Testme". IMHO, the build process should place the executable in the proper location and not simply use a link.

Regardless, I'm very impressed with the progress so far, and I'm looking forward to using Lazarus on Mac OS X for a long, long time.

_| () |-| |\| -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080731/c6a383da/attachment.html

Reply by email

Hess, Philip J
to John Stoneham

John,

Using a symlink to the executable is simply for your convenience in developing. When it's time to distribute the app, of course you would want to place the executable inside the .app folder, as follows:

rm "myapp.app/contents/macos/irris"

cp -p myapp "myapp.app/contents/macos"

Thanks.

-Phil

________________________________

From:
[mailto:] On Behalf Of John
Stoneham
Sent: Thursday, July 31, 2008 11:05 AM
To:
Subject: [Lazarus] Mac OS X (Carbon), executable placement issue

First of all, let me say I'm ecstatic about the progress on the native Carbon Mac OS X build. I've recently switched to Mac OS X completely (no Windows at all for me anymore), so finding Lazarus can use native Carbon widgets was like finding Christmas in July! :)

One thing that I question, though, is the decision to leave the main executable of a program outside the app bundle and using a link inside the app bundle to that executable. For example, lets say you've got a project called "Testme". In the build directory you will have both the "Testme" executable and the "Testme.app" bundle. Of course the question for the end user is "which one do I run?" since they both have the same filename (the ".app" extension is hidden in the Finder). Running the "Testme" executable from the command line doesn't work (oh, it runs, but it is inaccessible to mouse or keyboard input and must be stopped with a killall command). Running "Testme.app" does work fine (when using "open Testme.app" at the command line or double-clicking on it from the Finder). But leaving the main executable outside the bundle is non-standard and could cause problems for the end user, e.g. when double-clicking on the "Testme" executable instead of "Testme.app" since the ".app" is hidden in the finder. And it will look to the end user like there are two programs (or at least two files) with the same name. Instead of this approach, the "Testme" executable should be placed inside the "Testme.app" bundle at "Testme.app/Contents/MacOS/Testme". IMHO, the build process should place the executable in the proper location and not simply use a link.

Regardless, I'm very impressed with the progress so far, and I'm looking forward to using Lazarus on Mac OS X for a long, long time.

_| () |-| |\| -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080731/cc6445c4/attachment.html

Reply by email

John Stoneham
to Hess, Philip J

2008/7/31 Hess, Philip J

Show quoted text 23 lines
John, Using a symlink to the executable is simply for your convenience in developing. When it's time to distribute the app, of course you would want to place the executable inside the .app folder, as follows: rm "myapp.app/contents/macos/irris" cp -p myapp "myapp.app/contents/macos" Thanks. -Phil

Sorry, don't mean to nitpick, but it's not a , it
may be a convenience for the developer of the Lazarus build functions, but it's not a convenience to the developer of an application. I don't know, I really can't think of a reason for it to be placed outside the .app bundle at all. First, nothing can be done with executable directly outside the bundle. If you try to run it from the command-line, it remains frozen in the background, unable to accept any kind of input or focus. The only way to run it is from the .app bundle, as in "open MyApp.app" from the command line, or clicking on the .app bundle itself in the finder. And since these are the only two ways to run it, why shouldn't it placed there from the start?

_| () |-| |\| -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080802/fbe8185b/attachment-0001.html

Reply by email

Tobias Giesen
to John Stoneham
And since these are the only two ways to run it, why shouldn't it placed there from the start?

History. The binary compiled file was there first, and FPC places it into the specified output folder. For example, my output folder is /code07/exec.

The bundle came later. Now with a given binary compiled program in /code07/exec, the only way to add a bundle is to use a symbolic link to the binary program.

For distribution, you need to create a small script anyway, that does things like calling strip etc.

Cheers,
Tobias

http://www.superflexible.com

Reply by email

Felipe Monteiro de Carvalho
to John Stoneham: 2008/7/31 Hess, Philip J Sorry, don't mean to nitpick, but it's not a , it may be a…

I don't think it is such a big problem, because I usually have a script to create by deployment bundle, and another to create the development bundle, so the packaging really takes 1 click

In open source software the need usually brings development. If you consider this a greatly needed feature you could create a patch implementing it.

It would probably be a good idea to make this an option in the Project Options dialog.

Felipe Monteiro de Carvalho

Reply by email