Skip to content

Xojo2DMG: CodeSign, DMG creation and Notarization (Post Build Script)

License

Notifications You must be signed in to change notification settings

jo-tools/xojo2dmg

Repository files navigation

Xojo2DMG

Xojo2DMG: CodeSign, DMG creation and Notarization (Post Build Script)

License: MIT

Description

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.

Requirements

  1. Xojo running on macOS (obviously... you can't CodeSign for macOS on Windows)
  2. CodeSigning, CodeSigning-Validation and Notarization requires Xcode to be installed
  3. Xojo2DMG requires
    • to be run on macOS 11.3 (or later)
    • have Xcode 13 (or later) installed

ScreenShots

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). ScreenShot: Disk Image

Xojo IDE with the Post Build Script:
ScreenShot: Xojo IDE - PostBuildScript

Xojo

Requirements

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

How to use in your own Xojo project?

  1. Copy the folder scripts to your project folder.
  2. Create a PostBuild Script in your project and copy-and-paste the example PostBuild Script provided in Xojo2DMG.xojo_project.
  3. 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.
  4. Read the cComments in the provided Post Build Script, modify it according to your needs (CodeSign Entitlements, Notarization, DMG look and feel).

About

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.

Contact

E-Mail    Follow on Facebook    Follow on Twitter

Donation

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.

PayPal Dontation to jotools