diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.yml index 69c7927cd..98075b68d 100644 --- a/.github/workflows/desktop-release.yml +++ b/.github/workflows/desktop-release.yml @@ -67,15 +67,20 @@ jobs: codesign --verify --deep --strict "$app" - name: Build and smoke-test DMG run: | - staging="$RUNNER_TEMP/desktop-dmg" mount="$RUNNER_TEMP/desktop-mount" - mkdir -p "$staging" "$mount" release-assets - ditto apps/desktop/build/mac-arm64/OpenDirector.app "$staging/OpenDirector.app" - ln -s /Applications "$staging/Applications" + installer="$PWD/apps/desktop/installer/macos" + mkdir -p "$mount" release-assets dmg="OpenDirector-v${DESKTOP_VERSION}-mac-arm64-adhoc.dmg" - hdiutil create -volname OpenDirector -srcfolder "$staging" -format UDZO "release-assets/$dmg" + uv tool run --from 'dmgbuild==2.0.0' dmgbuild \ + -s "$installer/dmg-settings.py" \ + -D "app=$PWD/apps/desktop/build/mac-arm64/OpenDirector.app" \ + -D "background=$installer/background.png" \ + OpenDirector "release-assets/$dmg" hdiutil attach "release-assets/$dmg" -readonly -nobrowse -mountpoint "$mount" trap 'hdiutil detach "$mount"' EXIT + test -s "$mount/.DS_Store" + test -s "$mount/.background.tiff" + test "$(readlink "$mount/Applications")" = /Applications installed=$(mktemp -d "$RUNNER_TEMP/desktop-install.XXXXXX")/OpenDirector.app ditto "$mount/OpenDirector.app" "$installed" codesign --verify --deep --strict "$installed" diff --git a/apps/desktop/installer/macos/background.png b/apps/desktop/installer/macos/background.png new file mode 100644 index 000000000..34111e21f Binary files /dev/null and b/apps/desktop/installer/macos/background.png differ diff --git a/apps/desktop/installer/macos/background@2x.png b/apps/desktop/installer/macos/background@2x.png new file mode 100644 index 000000000..e32973300 Binary files /dev/null and b/apps/desktop/installer/macos/background@2x.png differ diff --git a/apps/desktop/installer/macos/dmg-settings.py b/apps/desktop/installer/macos/dmg-settings.py new file mode 100644 index 000000000..0c2e48534 --- /dev/null +++ b/apps/desktop/installer/macos/dmg-settings.py @@ -0,0 +1,20 @@ +from pathlib import Path + +app = Path(defines["app"]) +format = "UDZO" +filesystem = "APFS" +files = [str(app)] +symlinks = {"Applications": "/Applications"} + +# Keep presentation on the volume. Hiding the app extension adds Finder +# metadata to the signed bundle, which fails strict signature validation. +background = defines["background"] +window_rect = ((150, 150), (700, 410)) +icon_locations = {app.name: (190, 147), "Applications": (510, 147)} +icon_size = 90 +text_size = 13 +show_toolbar = False +show_tab_view = False +show_sidebar = False +show_pathbar = False +show_status_bar = False diff --git a/docs/guides/installation.md b/docs/guides/installation.md index 92939cd1d..2a653b829 100644 --- a/docs/guides/installation.md +++ b/docs/guides/installation.md @@ -2,6 +2,26 @@ [English](installation.md) · [简体中文](installation.zh-CN.md) · [Back to README](../../README.md) + + +## First launch on macOS + +The desktop DMG is for Apple silicon Macs. Download it from [OpenDirector's official GitHub Releases](https://github.com/ThinkFlowLab/OpenDirector/releases). + +1. Open the DMG in Finder. Drag **OpenDirector** into **Applications**. +2. In Finder, open **Applications** and double-click **OpenDirector**. +3. This build is not notarized by Apple. If macOS says it can't verify OpenDirector or its developer, confirm that the DMG came from the official release. Dismiss the alert, then go to **System Settings → Privacy & Security**, scroll to **Security**, and click **Open Anyway** for OpenDirector. Follow the confirmation prompt. [Apple's first-launch instructions](https://support.apple.com/en-us/102445) + +If **Open Anyway** is missing, try opening OpenDirector from **Applications** once and return to **Privacy & Security**. If your organization manages the Mac, contact your administrator. + +If Finder can't open the DMG, download it again and compare its SHA-256 with the `.sha256` file next to that exact installer on GitHub Releases. Run `shasum -a 256` followed by the path to the downloaded DMG to print its checksum. If the DMG still won't open, report the exact message and the macOS version. + +If macOS says the **app** is damaged, reports malware, or says the app will damage your computer, stop and report the alert. + + + +## Install from source or a wheel + ### 1. Prepare your environment | Dependency | Requirement | diff --git a/docs/guides/installation.zh-CN.md b/docs/guides/installation.zh-CN.md index 121183388..6089683a0 100644 --- a/docs/guides/installation.zh-CN.md +++ b/docs/guides/installation.zh-CN.md @@ -2,6 +2,26 @@ [English](installation.md) · [简体中文](installation.zh-CN.md) · [返回首页](../../README.zh-CN.md) + + +## macOS 首次打开 + +桌面版 DMG 适用于搭载 Apple 芯片的 Mac。请从 [OpenDirector 官方 GitHub Releases](https://github.com/ThinkFlowLab/OpenDirector/releases) 下载安装包。 + +1. 在访达中打开 DMG,把 **OpenDirector** 拖入「应用程序」。 +2. 在访达的「应用程序」中双击 **OpenDirector**。 +3. 此版本未经 Apple 公证。若 macOS 提示无法验证 OpenDirector 或其开发者,先确认 DMG 来自官方 Release。关闭提示后,打开「系统设置 → 隐私与安全性」(部分版本称「隐私与安全」),向下滚动到「安全性」,找到 OpenDirector,点按「仍要打开」并按提示确认。[Apple 的首次打开说明](https://support.apple.com/zh-cn/102445) + +如果看不到「仍要打开」,请先从「应用程序」尝试打开 OpenDirector 一次,再回到「隐私与安全性」。如果 Mac 由单位管理,请联系管理员。 + +如果访达无法打开 DMG,请重新下载,并用 GitHub Releases 上对应安装包旁的 `.sha256` 文件核对校验值。在终端输入 `shasum -a 256` 和下载的 DMG 路径,即可查看校验值。如果 DMG 仍打不开,请反馈原始提示和 macOS 版本。 + +如果 macOS 提示 **App** 已损坏、识别到恶意软件,或提示 App 会损坏电脑,请停止并反馈原始提示。 + + + +## 通过源码或 wheel 安装 + ### 1. 准备环境 | 依赖 | 要求 |