Tools and %EXECUTABLE

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
jamirokwai
Enthusiast
Enthusiast
Posts: 796
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Tools and %EXECUTABLE

Post 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... :-)
Regards,
JamiroKwai
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Tools and %EXECUTABLE

Post 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.
quidquid Latine dictum sit altum videtur
jamirokwai
Enthusiast
Enthusiast
Posts: 796
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Tools and %EXECUTABLE

Post 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)
Regards,
JamiroKwai
Post Reply