Recent

Author Topic: [SOLVED] CFBundleVersion value not set in Info.plist of App Bundle  (Read 3271 times)

Gizmo

  • Hero Member
  • *****
  • Posts: 831
I noticed following a bug report that when one creates an app bundle with Lazarus for Apple OSX, the CFBundleVersion is set, by default, to 0.1. even when the Project Settings have the build and version number defined.

The value is stored in the bundles Info.plist file. And if I, as the developer, go in and edit the info.plist file manually to show "1.3.2" (or whatever value I need), it then displays properly in the Apple Finder properties of the app bundle.

But I wonder if Lazarus should be\could be\will be updated to do that for us automatically when the App bundle is created? Or is there a setting somewhere I am missing that I need to enable? I am using v2.0.10 on OSX< which I appreciate is a release behind 2.0.12, so it may be that it is corrected in that but sadly I am not able to apply that release to my Apple so cant check.

(PS I did read this, which seems to be a way to achieve it programmatically : https://wiki.lazarus.freepascal.org/Mac_Show_Application_Title,_Version,_and_Company but my point is that all that needs to happen when the developer hits the "Crate App Bundle" button is for Lazarus to lookup the project version number and copy it to the info.plist file. I can also see here that Lazarus itself has this setting applied, but perhaps via code pipeline automation than by Lazarus itself https://wiki.freepascal.org/Lazarus_2.0_fixes_branch#Fixes_for_2.0.12_.28merged.29 )
« Last Edit: June 07, 2021, 10:24:53 am by Gizmo »

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: CFBundleVersion value not set in Info.plist of App Bundle
« Reply #1 on: May 27, 2021, 01:24:11 pm »
This is an interesting and, of course, important question.

I always use to create and edit the info.plist files of my apps manually. Before releasing a new version I copy the files into the app bundle. This works perfectly and leaves much room for manual optimisation.

But you are right that it would be way more elegant if the Lazarus IDE would be able to automate this process.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: CFBundleVersion value not set in Info.plist of App Bundle
« Reply #2 on: May 30, 2021, 04:50:18 am »
I do what jwdietrich does, the last thing I do is copy in my own plist file(s) at the same time as I delete the link and copy in the executable (which includes both Intel and ARM64 binaries).

Short of providing a plist file editor, Lazarus will not be able to setup all the things that an application may require in its plist files. The current defaults generally at least provides a working application bundle for users who have yet to become acquainted with plist files.

 

TinyPortal © 2005-2018