Jump to content
Sign in to follow this  
Nicolò Blunda

Get copyright info from code in macOS

Recommended Posts

Hello.
With this code (working on macOS) I get application version info:

VersionInfoString:= (TNSString.Wrap(CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle, kCFBundleVersionKey))).UTF8String;

I want to retreive the copyright info too.
In info.plist the copyright string is the NSHumanReadableCopyright key value.
It is possible to adapt code above to get it?

Edited by Nicolò Blunda

Share this post


Link to post
1 hour ago, Nicolò Blunda said:

It is possible to adapt code above to get it?

It seems it is not included by default in macOS apps produced by Delphi. When it is included, you could use the following code:

Value := NSStrToStr(TNSString.Wrap(CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle, StringToID('NSHumanReadableCopyright'))));

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×