Tool for Info.plist, UPX

Mac OSX specific forum
jamirokwai
Enthusiast
Enthusiast
Posts: 772
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Tool for Info.plist, UPX

Post by jamirokwai »

Hi there,

I was struggling about the need to copy the Info.plist to the compiled-bundle manually every time...
This Tool for the Tools-menu does the same. Use at own risk! :-)

1. Just create the Info.plist according to your needs, and save it in the same directory as the source, like
mysource.pb
info.plist

2. Add this Tool:
Commandline: cp
Arguments: "%PATH/info.plist" "%EXECUTABLE/Contents"
Working Directory: %PATH
Name: Copy List (or as you like)
Event to trigger: After Create Executable

That's it. Everytime, you create the executable of your App-Bundle, the Info.plist gets copied to the bundle automagically ... It doesn't even matter, where you want to put the App-Bundle.



If you like to compress the executable inside the .App-Bundle, you can use this:

1. PureBasic-Code, compile to /Users/joe/makeupx in Console-format

Code: Select all

file$ = ProgramParameter(0)
part$ = GetFilePart(file$)
path$ = GetPathPart(file$) + part$ + "/Contents/MacOS/" + Left(part$,Len(part$)-4)
RunProgram("/usr/bin/upx","-9 --lzma " + path$,"") ; --lzma is optional, since I use the custom lzma-build for Mac OS X from www.idrix.fr
2. Add this Tool:
Commandline: /Users/joe/makeupx
Arguments: "%EXECUTABLE"
Working Directory:
Name: UPXer or as you like)
Event to trigger: After Create Executable

For the Mac, you need to get UPX from here: http://www.idrix.fr/Root/content/category/7/26/46/
Last edited by jamirokwai on Fri Oct 26, 2012 11:32 am, edited 5 times in total.
Regards,
JamiroKwai
WilliamL
Addict
Addict
Posts: 1224
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: Tool for Info.plist

Post by WilliamL »

Thanks jamirokwai!

I struggled with this a while back and couldn't seem to find the right combination.

This works perfectly! I thought %PATH or %EXECUTABLE would have to be replaced with my info but that is not the case. I just used the text as shown!.
MacBook Pro-M1 (2021), Sonoma 14.4.1, PB 6.10LTS M1
jamirokwai
Enthusiast
Enthusiast
Posts: 772
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Tool for Info.plist, UPX

Post by jamirokwai »

Added how-to to UPX your executables after compilation. See first post.
Regards,
JamiroKwai
Wolfram
Enthusiast
Enthusiast
Posts: 568
Joined: Thu May 30, 2013 4:39 pm

Re: Tool for Info.plist, UPX

Post by Wolfram »

jamirokwai wrote:Hi there,

I was struggling about the need to copy the Info.plist to the compiled-bundle manually every time...
This Tool for the Tools-menu does the same. Use at own risk! :-)

1. Just create the Info.plist according to your needs, and save it in the same directory as the source, like
mysource.pb
info.plist

2. Add this Tool:
Commandline: cp
Arguments: "%PATH/info.plist" "%EXECUTABLE/Contents"
Working Directory: %PATH
Name: Copy List (or as you like)
Event to trigger: After Create Executable

That's it. Everytime, you create the executable of your App-Bundle, the Info.plist gets copied to the bundle automagically ... It doesn't even matter, where you want to put the App-Bundle.
I think there is a mistake in "Arguments: "%PATH/info.plist" "%EXECUTABLE/Contents""
On my MAc it works only if I remove the slash after %PATH
Arguments: "%PATHinfo.plist" "%EXECUTABLE/Contents"
macOS Catalina 10.15.7
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Tool for Info.plist, UPX

Post by wilbert »

jamirokwai wrote:I was struggling about the need to copy the Info.plist to the compiled-bundle manually every time...
This Tool for the Tools-menu does the same. Use at own risk! :-)
There's also another tool to work with Info.plist I created together with Joe Baker.
http://www.purebasic.fr/english/viewtop ... 27&t=53905
Windows (x64)
Raspberry Pi OS (Arm64)
jamirokwai
Enthusiast
Enthusiast
Posts: 772
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Tool for Info.plist, UPX

Post by jamirokwai »

wilbert wrote:
jamirokwai wrote:I was struggling about the need to copy the Info.plist to the compiled-bundle manually every time...
This Tool for the Tools-menu does the same. Use at own risk! :-)
There's also another tool to work with Info.plist I created together with Joe Baker.
http://www.purebasic.fr/english/viewtop ... 27&t=53905
Hi wilbert,
thanks for the hint!
Regards,
JamiroKwai
Post Reply