How to set bundle identifier? lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- wittbo · 2016-11-22 10:06 I'm actually testing the way how to save preferences. I found the methods and everything seemed to work well, no error report. When I wanted to check the results, I was looking for the ~/Library/Preferences/.plist file. And, surprise, I found a file named .../com.company..plist. Checking of the info.plist file within the application bundle found, that com.company is the name of the bundle identifier. Does anyone know, where to set this bundle identifier? I would expect this in the Lazarus project Settings, but nothing found expect the button "create application bundle".  Is there a general script, which contains something like a template of the application bundle? wittbo ---------------------------------------------------------------------- jwdietrich · 2016-11-22 12:26 On macOS and related operating systems this information is provided by an Info.plist file. The required information is stored in the CFBundleIdentifier key. In the finished application the Info.plist file is stored in the Contents folder within the bundle. There are excellent articles in the Free Pascal wiki describing platform-sensitive development for macOS. See the Mac Portal there for an overview. There is also a comprehensive reference page on Info.plist files in Apple's developer area, which provides detailled information. ---------------------------------------------------------------------- wittbo · 2016-11-22 14:54 Thank you for your answer.. But my question is: the whole bundle including the info.plist file is fully generated by Lazarus upon program development. What is the way how the information gets into the info.plist file. If I am coding with Xcode, I have full control over that within the xcode IDE. How will Lazarus manage this process? It's really no problem to update the info.plist file after program development has been finished, but this is not the elegant way. wittbo. ---------------------------------------------------------------------- Phil · 2016-11-22 15:01 Quote from: wittbo on November 22, 2016, 03:54:51 pmHow will Lazarus manage this process? It's really no problem to update the info.plist file after program development has been finished, but this is not the elegant way. Lazarus does not provide any facilities to set or update the Info.plist file. However, if you create your app with this package, you enter the bundle ID at project creation; and relevant bits of the version info that you enter in the Laz IDE get copied / updated to the Info.plist when you next compile. https://macpgmr.github.io/MacXPlatform/LazXProj.html ---------------------------------------------------------------------- wittbo · 2016-11-22 16:37 This package is really interesting. Thank you for your tip. I found on a fresh test, that upon the first compile Lazarus creates the bundle structure including the info.plist file, which contains some standard pattern. One of these is the bundle identifier with fix com.company. followed by my app name.You can then go into this file located in the bundle and change it manually with any text editor, i.e. TextWrangler. Lazarus won't change those items upon next compile. ---------------------------------------------------------------------- Phil · 2016-11-22 17:16 Quote from: wittbo on November 22, 2016, 05:37:59 pmLazarus won't change those items upon next compile. I hope you understand that's exactly the problem: Lazarus treats the .app file as part of your source code. To distribute a project's full source, including modified Info.plist, you would also have to include the .app bundle, which typically includes executable files too. All other Mac IDEs treat the .app bundle as a build product. Meaning that a clean deletes the .app bundle and the next build completely re- creates the .app bundle. But on Lazarus, a true clean means you would lose any changes that you made manually to the .app bundle: Info.plist, icon file, files copied to Resources, etc. If you use the LazXProj approach, at least the Info.plist is kept with your source files and only copied to .app bundle after compiling. Again, this is the approach that all other IDEs take. Only Lazarus deviates from this. ---------------------------------------------------------------------- wittbo · 2016-11-22 17:30 Thank you, Phil, for this clarification. My understanding is now quite clear. And sorry some maybe stupid questions. I'm relatively new on Lazarus. ---------------------------------------------------------------------- Phil · 2016-11-22 17:31 Quote from: wittbo on November 22, 2016, 06:30:01 pmAnd sorry some maybe stupid questions. I would say those were good questions. ---------------------------------------------------------------------- jwdietrich · 2016-11-22 19:20 Quote from: Phil on November 22, 2016, 06:31:47 pmQuote from: wittbo on November 22, 2016, 06:30:01 pmAnd sorry some maybe stupid questions. I would say those were good questions. Yes, they were in fact good questions - and good answers. Up to now I wasn't aware of LazXProj. If you really need an alternative, you might also edit the Info.plist files with Apple's Property List Editor (it comes with Xcode) or even a simple text editor, e.g. TextWrangler. ---------------------------------------------------------------------- Phil · 2016-11-22 19:40 Quote from: jwdietrich on November 22, 2016, 08:20:41 pmUp to now I wasn't aware of LazXProj. You might bookmark this page. That's where I have links to anything new: https://macpgmr.github.io