Skip to content

Commit

Permalink
Xojo 2023r4 | API 2 (#16)
Browse files Browse the repository at this point in the history
* Saved with Xojo 2023r4

* Update jo-tools/applescript-automation

* Xojo: Auto Convert to API 2

* Add Pragma unused

* Xojo API 2: Fix Deprecations

* Xojo API 2: Dim - Var

* Style: Whitespace

* Xojo API 2: Post Build Script

* Update Comments in Post Build Script

* Version 2.0.0

* Adjust DMG Settings

* Update ReadMe and ScreenShots

* Update Example Build
  • Loading branch information
jo-tools authored Mar 9, 2024
1 parent 60a8e44 commit 2d170c5
Show file tree
Hide file tree
Showing 13 changed files with 634 additions and 467 deletions.
251 changes: 127 additions & 124 deletions Build Automation.xojo_code

Large diffs are not rendered by default.

25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Xojo2DMG
Xojo2DMG: CodeSign, DMG creation and Notarization (Post Build Script)
Xojo2DMG: CodeSign, DMG creation and Notarization *(Post Build Script)*

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)

Expand All @@ -9,19 +9,19 @@ A requirement for that is to CodeSign with Hardened Runtime. This might lead to
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 Script provided.
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
5. Xojo2DMG requires
1. to be run on **macOS 11.3** *(or later)*
2. have **Xcode 13** *(or later)* installed
3. Xojo2DMG requires
* to be run on **macOS 11.3** *(or later)*
* have **Xcode 13** *(or later)* installed


### ScreenShots
[This DMG](example-build/Xojo2DMG.dmg) has been created with Xojo2DMG *(built with Xojo 2022r2, macOS 12.6, Xcode 14.0.1 for CodeSigning/Notarization)*. It contains the built example app *(built as macOS Universal: x86_64 & ARM64)*.
[This DMG](example-build/Xojo2DMG.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](screenshots/xojo2dmg_screenshot_1.png?raw=true)

Xojo IDE with the Post Build Script:
Expand All @@ -31,16 +31,15 @@ Xojo IDE with the Post Build Script:
### Requirements
[Xojo](https://www.xojo.com/) is a rapid application development for Desktop, Web, Mobile & Raspberry Pi.

The Desktop application Xojo example project ```Xojo2DMG.xojo_project``` is using:
- Xojo 2018r4
- API 1
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.
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.
*Note: You even need to do this if you're opening this example project in Xojo 2022r1+. The reason is that Xojo 2018r4 *(which has been used to save this example project)* doesn't have Xojo's 'Sign' step - and all existing Post Build steps are being placed before 'Sign' by default.*
4. Read the Comments in PostBuild Script, modify according to your needs *(CodeSign Entitlements, Notarization, DMG look and feel)*.
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](https://cmiag.ch/). Their Application [CMI LehrerOffice](https://cmi-bildung.ch/) is a Xojo Design Award Winner 2018. In his leisure time Juerg provides some [bits and pieces for Xojo Developers](https://www.jo-tools.ch/).
Expand Down
22 changes: 14 additions & 8 deletions Xojo2DMG.xojo_project
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
Type=Desktop
RBProjectVersion=2018.04
MinIDEVersion=20150400
RBProjectVersion=2023.04
MinIDEVersion=20210300
OrigIDEVersion=00000000
Folder=resources;resources;&h000000003990F7FF;&h0000000000000000;false
BuildSteps=Build Automation;Build Automation.xojo_code;&h000000007106C7FF;&h0000000000000000;false
Folder=Xojo2DMG;Xojo2DMG;&h00000000605BD7FF;&h0000000000000000;false
Plist=Info;scripts/resources/Info.plist;&h000000005435A7FF;&h00000000605BD7FF;false
Class=App;Xojo2DMG/App.xojo_code;&h000000004AFCCFFF;&h00000000605BD7FF;false
Window=Window1;Xojo2DMG/Window1.xojo_window;&h0000000074773FFF;&h00000000605BD7FF;false
DesktopWindow=Window1;Xojo2DMG/Window1.xojo_window;&h0000000074773FFF;&h00000000605BD7FF;false
MenuBar=MainMenuBar;Xojo2DMG/MainMenuBar.xojo_menu;&h00000000371E07FF;&h00000000605BD7FF;false
Module=modMacOsApplications;Xojo2DMG/modMacOsApplications.xojo_code;&h0000000009304FFF;&h00000000605BD7FF;false
Module=modAppleScriptUtils;Xojo2DMG/modAppleScriptUtils.xojo_code;&h000000002EF41FFF;&h00000000605BD7FF;false
Class=XojoScriptEvaluator;Xojo2DMG/XojoScriptEvaluator.xojo_code;&h00000000711AED1D;&h00000000605BD7FF;false
MultiImage=AppIcon_128;resources/AppIcon_128.xojo_image;&h000000006DB3EFFF;&h000000003990F7FF;false
MultiImage=PayPal;resources/PayPal.xojo_image;&h000000000F8CD7FF;&h000000003990F7FF;false
DefaultWindow=Window1
AppMenuBar=MainMenuBar
MajorVersion=1
MinorVersion=1
SubVersion=1
MajorVersion=2
MinorVersion=0
SubVersion=0
NonRelease=0
Release=2
InfoVersion=Xojo2DMG
LongVersion=jo-tools.ch
ShortVersion=1.1.1
ShortVersion=2.0.0
WinCompanyName=jo-tools.ch
WinInternalName=Xojo2DMG
WinProductName=Xojo2DMG
Expand All @@ -46,9 +48,13 @@ UseBuildsFolder=True
HiDPI=True
DarkMode=True
CopyRedistNextToWindowsEXE=False
IncludePDB=False
WinUIFramework=False
IsWebProject=False
LinuxBuildArchitecture=1
MacBuildArchitecture=1
MacBuildArchitecture=4
LinuxNormalizeControlSizes=True
OptimizationLevel=6
WindowsVersions={35138b9a-5d96-4fbd-8e2d-a2440225f93a}|{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}|{1f676c76-80e1-4239-95bb-83d0f6d0da78}|{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}
WindowsRunAs=0
MacOSMinimumVersion=
Binary file modified Xojo2DMG.xojo_resources
Binary file not shown.
6 changes: 3 additions & 3 deletions Xojo2DMG/App.xojo_code
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#tag Class
Protected Class App
Inherits Application
Inherits DesktopApplication
#tag Event
Sub Open()
Me.AutoQuit = True
Sub Opening()
Me.AllowAutoQuit = True
End Sub
#tag EndEvent

Expand Down
55 changes: 33 additions & 22 deletions Xojo2DMG/MainMenuBar.xojo_menu
Original file line number Diff line number Diff line change
@@ -1,95 +1,106 @@
#tag Menu
Begin Menu MainMenuBar
Begin MenuItem FileMenu
Begin DesktopMenuItem FileMenu
SpecialMenu = 0
Text = "&File"
Index = -2147483648
Text = "&File"
AutoEnabled = True
AutoEnable = True
Visible = True
Begin QuitMenuItem FileQuit
Begin DesktopQuitMenuItem FileQuit
SpecialMenu = 0
Text = "#App.kFileQuit"
Index = -2147483648
Text = "#App.kFileQuit"
ShortcutKey = "#App.kFileQuitShortcut"
Shortcut = "#App.kFileQuitShortcut"
AutoEnabled = True
AutoEnable = True
Visible = True
End
End
Begin MenuItem EditMenu
Begin DesktopMenuItem EditMenu
SpecialMenu = 0
Text = "&Edit"
Index = -2147483648
Text = "&Edit"
AutoEnabled = True
AutoEnable = True
Visible = True
Begin MenuItem EditUndo
Begin DesktopMenuItem EditUndo
SpecialMenu = 0
Text = "&Undo"
Index = -2147483648
Text = "&Undo"
ShortcutKey = "Z"
Shortcut = "Cmd+Z"
MenuModifier = True
AutoEnabled = True
AutoEnable = True
Visible = True
End
Begin MenuItem EditSeparator1
Begin DesktopMenuItem EditSeparator1
SpecialMenu = 0
Text = "-"
Index = -2147483648
Text = "-"
AutoEnabled = True
AutoEnable = True
Visible = True
End
Begin MenuItem EditCut
Begin DesktopMenuItem EditCut
SpecialMenu = 0
Text = "Cu&t"
Index = -2147483648
Text = "Cu&t"
ShortcutKey = "X"
Shortcut = "Cmd+X"
MenuModifier = True
AutoEnabled = True
AutoEnable = True
Visible = True
End
Begin MenuItem EditCopy
Begin DesktopMenuItem EditCopy
SpecialMenu = 0
Text = "&Copy"
Index = -2147483648
Text = "&Copy"
ShortcutKey = "C"
Shortcut = "Cmd+C"
MenuModifier = True
AutoEnabled = True
AutoEnable = True
Visible = True
End
Begin MenuItem EditPaste
Begin DesktopMenuItem EditPaste
SpecialMenu = 0
Text = "&Paste"
Index = -2147483648
Text = "&Paste"
ShortcutKey = "V"
Shortcut = "Cmd+V"
MenuModifier = True
AutoEnabled = True
AutoEnable = True
Visible = True
End
Begin MenuItem EditClear
Begin DesktopMenuItem EditClear
SpecialMenu = 0
Text = "#App.kEditClear"
Index = -2147483648
Text = "#App.kEditClear"
AutoEnabled = True
AutoEnable = True
Visible = True
End
Begin MenuItem EditSeparator2
Begin DesktopMenuItem EditSeparator2
SpecialMenu = 0
Text = "-"
Index = -2147483648
Text = "-"
AutoEnabled = True
AutoEnable = True
Visible = True
End
Begin MenuItem EditSelectAll
Begin DesktopMenuItem EditSelectAll
SpecialMenu = 0
Text = "Select &All"
Index = -2147483648
Text = "Select &All"
ShortcutKey = "A"
Shortcut = "Cmd+A"
MenuModifier = True
AutoEnabled = True
AutoEnable = True
Visible = True
End
Expand Down
Loading

0 comments on commit 2d170c5

Please sign in to comment.