Xojo2DMG: CodeSign, DMG creation and Notarization (Post Build Script)
Are you distributing macOS Software outside of the Mac App Store? For your users best experience and confidence, your applications have to be notarized by Apple. A requirement for that is to CodeSign with Hardened Runtime. This might lead to a different Runtime behavior compared to a simple (unsigned) DebugRun within the Xojo IDE. That's why I encourage everyone to CodeSign (with Hardened Runtime) each and every DebugRun on macOS, allowing you to develop and debug as close to a Release Build as possible.
This example shows how a Post Build Script can be used in a Xojo project in order to create a customized DiskImage, sign and notarize both .app and .dmg. You can easily customize the DiskImage's appearance by setting a couple of Variables in the Post Build Script. Additionally, even Notarization can be performed fully scripted. That requires to set up an item in your Keychain - see Info in the Scripts provided.
- Xojo running on macOS (obviously... you can't CodeSign for macOS on Windows)
- CodeSigning, CodeSigning-Validation and Notarization requires Xcode to be installed
- Xojo2DMG requires
- to be run on macOS 11.3 (or later)
- have Xcode 13 (or later) installed
This DMG has been created with Xojo2DMG (built with Xojo 2023r4, macOS 14.4, Xcode 15.3 for CodeSigning/Notarization). It contains the built example app (built as macOS Universal: x86_64 & ARM64).
Xojo IDE with the Post Build Script:
Xojo is a rapid application development for Desktop, Web, Mobile & Raspberry Pi.
The Desktop application Xojo example project Xojo2DMG.xojo_project
and its Post Build Script is using:
- Xojo 2023r4
- API 2
- Copy the folder
scripts
to your project folder. - Create a PostBuild Script in your project and copy-and-paste the example PostBuild Script provided in
Xojo2DMG.xojo_project
. - If you're using Xojo 2022r1 (or newer): make sure this PostBuild Script runs after the Step 'Sign'. Otherwise Xojo will overwrite the CodeSigning again with it's 'Sign' step.
- Read the cComments in the provided Post Build Script, modify it according to your needs (CodeSign Entitlements, Notarization, DMG look and feel).
Juerg Otter is a long term user of Xojo and working for CM Informatik AG. Their Application CMI LehrerOffice is a Xojo Design Award Winner 2018. In his leisure time Juerg provides some bits and pieces for Xojo Developers.
Do you like this project? Does it help you? Has it saved you time and money?
You're welcome - it's free... If you want to say thanks I'd appreciate a message or a small donation via PayPal.