Page 1 of 1

Tools and %EXECUTABLE

Posted: Sun Aug 22, 2010 7:45 am
by jamirokwai
edit: after sending... This is not quite a bug, but more some kind of feature request. Sorry for that.


Dear Board,

regarding this: http://www.purebasic.fr/english/viewtop ... 041#p99041 (Executable-check on runtime - great thing!)

I found this issue: When compiling the word %EXECUTABLE gives back the name of the Console-App or the Name of the App-Bundle. The name of the Console-App is really useful, but the Name of the App-Bundle is not helpful for the above exe-checker. For now I have to give the full working path to my to-be-executable inside the App-Bundle.

Please, either introduce a second constant %EXECUTABLEFILE, e.g. which points to the executable (xyz.app/Contents/MacOS/xyz) or set the %EXECUTABLE accordingly to a console or MacOS-app :-)

The Best solution for us Mac-coders would be...

%EXECUTABLE
Console: point to executable
MacOS: point to executable xyz.app/Contents/MacOS/xyz

%EXECETUABLEDIRECTORY
Console: point to executables directory
MacOS: point to xyz.app/Contents/MacOS

%APPDIRECTORY
Console: point to executables directory
MacOS: point to xyz.app

Thanks for reading... :-)

Re: Tools and %EXECUTABLE

Posted: Sun Aug 22, 2010 8:00 pm
by freak
%EXECETUABLEDIRECTORY is not needed, you can just use the GetPathPart() command on %EXECUTABLE.
Since this is an OSX specific thing, something like %BUNDLE may be enough.

Btw, you can reconstruct the real executable file from the bundle directory even now.
You just have to turn "<Path>/<Name>.app" into "<Path>/<Name>.app/Contents/MacOS/<Name>". This is always the same naming scheme.

Re: Tools and %EXECUTABLE

Posted: Sun Aug 22, 2010 9:53 pm
by jamirokwai
freak wrote:%EXECETUABLEDIRECTORY is not needed, you can just use the GetPathPart() command on %EXECUTABLE.
Since this is an OSX specific thing, something like %BUNDLE may be enough.

Btw, you can reconstruct the real executable file from the bundle directory even now.
You just have to turn "<Path>/<Name>.app" into "<Path>/<Name>.app/Contents/MacOS/<Name>". This is always the same naming scheme.
Hi Freak,

thanks for the hint. Works great now...
I changed your MD5-inside-executable-after-compile-idea to work with Mac OS X...
(from here: http://www.purebasic.fr/english/viewtop ... 041#p99041)