Recent

Author Topic: Mac Application Bundle Wizard  (Read 3327 times)

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Mac Application Bundle Wizard
« on: November 22, 2018, 09:20:34 pm »
I've spend the day working on a (stand-alone as a start) wizard to deal with all those steps required to reach an Apple Store compatible installer starting with a simple Darwin binary as created by Lazarus:

* Updating permissions
* Verifying Info.plist is including essential information for notarizing, and updating it from .lpi
* Telling the system to forget other locations
* Codesigning app bundle with entitlements and requirements for notarizing
* Creating installer package
* Codesigning installer package
* Starting notarizing installer package

It basically wraps a lengthly bash script with added validations.

Right now it has an included entitlements file editor (with only Sandbox entitlements implemented so far).
An Info.plist editor will be next.

Setting the fields or using a predefined defaults.ini for a single project is annoying, but it's getting somewhere it can be useful ;)

https://gitlab.com/ccrdude/lazarus-mac-application-wizard

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: Mac Application Bundle Wizard
« Reply #1 on: November 22, 2018, 09:56:57 pm »



I was working on something similar - this is great!  :)
I'll go play with it in the next few days!
Excellent!


Two questions;


1) Does it remove "icon?" files as well?


I had this once cause problems with signing, until I removed the file.
I believe you can add such a "icon?" file by pulling up file info in Finder, and pasting a png on the icon.


2) Does it sign additional executables as well?


I had issues with the "--deep" option, so for me to sign my application. I need to sign the additional executable first (also on Content/MacOS), and sign the entire .app after that - both without using the "--deep" option (!). I'm not sure if this may be needed for frameworks as well - I haven't used frameworks yet.


mischi

  • Full Member
  • ***
  • Posts: 170
Re: Mac Application Bundle Wizard
« Reply #2 on: November 22, 2018, 10:34:26 pm »
Very nice. Do you consider to tag version or releases? That would make it easy for me to create a package description for fink, the macOS package manager. Release or tags make a nice versioning than the combination of dates and commit numbers.

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: Mac Application Bundle Wizard
« Reply #3 on: November 23, 2018, 10:33:11 am »
@Hansaplast:
1. I pushed another commit. Now it removes "Icon", and uses xattr -cr to clean any extended attributes. Thanks for pointing me at that issue :)
2. It uses "deep" indeed. Not sure if App Store allows other projects?  I implemented an option to sign non-deep.

@mischi:
Right now it's still so much work in progress. I've used it a dozen times, but it needs persistence of the input data at least to be somewhat useful in regular use.
Once it's a package, tagging/versioning would indeed be a good idea :)
« Last Edit: November 23, 2018, 01:31:27 pm by CCRDude »

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: Mac Application Bundle Wizard
« Reply #4 on: November 26, 2018, 05:56:51 pm »
There still was a way to the Store, but with todays last commits, the tool is now able to test / prepare everything required to be able to submit a .pkg using Application Loader without any further errors.

The last issues I encountered was finding the correct type of signing identities (those are now indicated in the UI), having icons in all the right sizes (will now be tested to warn if missing), having a product category set, etc.

There's still lots of room for improvement of course, but I'm waiting on a reply to my first submission from Apple now (if Application Loader worked as intended, but that's for another topic).

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: Mac Application Bundle Wizard
« Reply #5 on: November 27, 2018, 01:56:28 am »
Thanks CCRDude, I look forward to continued development.

The requirements that Apple throws at small developers become increasingly onerous. I enjoy coding, but struggling with these issues is not fun. Back in the day Apple loved individual programmers and 'hackers', no more. Unfortunately a lot of my base users, as well as myself, run Macs.

Cheers,
VTwin
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: Mac Application Bundle Wizard
« Reply #6 on: December 08, 2018, 12:35:44 pm »
Workflow now seems confirmed to be working. The testing at Apple tool nearly two weeks, but my app is live now:
https://itunes.apple.com/us/app/spybot-identity-monitor/id1444522322

With the steps being confirmed, I guess my next steps will be to convert the stand-alone thing into a Lazarus IDE package.
Need to find a good way to make it simple still ;)

MISV

  • Hero Member
  • *****
  • Posts: 783
Re: Mac Application Bundle Wizard
« Reply #7 on: December 08, 2018, 05:41:17 pm »
Just quick question. Please also consider having it call "strip".

When compiling in IDE this does not work.

Using strip afterwards (no matter what IDE settings) usually cuts off 15% in size (and presumable less/no debug info for other to tinker with)

 

TinyPortal © 2005-2018