diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ad1f9d95..b7641fbc8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,9 @@ # artifacts instead of publishing it. # # Each release has Lemon Studio for Windows (.exe), Linux (.AppImage) and macOS (Apple silicon .app, zipped), each -# carrying its updater, and Lemon Studio's plugins for other DAWs (VST3 and CLAP, a zip per platform). The manifest +# carrying its updater, and Lemon Studio's plugins for other DAWs (VST3 and CLAP, a zip per platform). Beside them are +# the installers for a first install (docs/installers.md): for Windows a setup .exe and an .msi, for macOS a .dmg. The +# updater never uses those: it replaces the program. The manifest # (nightly.json or stable.json) is signed with minisign: the repository secret MINISIGN_SECRET_KEY signs it, and the # repository variable MINISIGN_PUBLIC_KEY, built into the updater, checks it. name: Release @@ -155,6 +157,15 @@ jobs: - name: Build the plugins run: cargo run --release --locked -p bundle-plugins + # A fixed version: WiX 7 asks everyone building with it to accept its maintainers' licence (docs/installers.md). + - name: Install WiX + if: runner.os == 'Windows' + run: | + dotnet tool install --global wix --version 6.0.2 + export PATH="$PATH:$HOME/.dotnet/tools" + cygpath -w "$HOME/.dotnet/tools" >>"$GITHUB_PATH" + wix extension add -g WixToolset.Util.wixext/6.0.2 WixToolset.BootstrapperApplications.wixext/6.0.2 + - name: Package run: | set -euo pipefail @@ -190,6 +201,11 @@ jobs: macOS) ditto -c -k --keepParent "$p" "dist/LemonStudio-Plugins-$v-$PLATFORM.zip" ;; *) (cd plugins && zip -qry "../dist/LemonStudio-Plugins-$v-$PLATFORM.zip" "LemonStudio-Plugins-$v") ;; esac + # The installers, for a first install. Windows': the program and the plugins, which it offers to install. + case "$RUNNER_OS" in + Windows) bash tools/package/windows/build.sh "dist/$program.exe" "$v" "$LEMON_CHANNEL" "$p" dist ;; + macOS) bash tools/package/dmg.sh "target/bundled/$app.app" "dist/$program.dmg" "$LEMON_CHANNEL" ;; + esac ls -l dist - uses: actions/upload-artifact@v4 diff --git a/docs/alpha-checklist.md b/docs/alpha-checklist.md index 1252c1e86..98e1c4bba 100644 --- a/docs/alpha-checklist.md +++ b/docs/alpha-checklist.md @@ -247,6 +247,8 @@ contributions that add other installers or packaging are declined. - [ ] **Prebuilt binaries for Windows, macOS and Linux.** The release workflow builds them, a nightly from main every night and a tagged release from a `vMAJOR.MINOR.PATCH` tag: a Windows `.exe`, a Linux AppImage and a macOS `.app` (Apple silicon), each updating itself (`lemonstudio-updater`), and the plugins for other DAWs as a zip per platform. + Installers for a first install go beside them: a setup `.exe` and an `.msi` for Windows, a `.dmg` for macOS + ([installers.md](installers.md)). Left: the steps under "Going live" in [releasing.md](releasing.md), its first run and trying the updates on each platform among them - [x] **Complete [THIRD-PARTY-NOTICES.txt](../THIRD-PARTY-NOTICES.txt).** Every crate that goes into a build is diff --git a/docs/installers.md b/docs/installers.md new file mode 100644 index 000000000..3df0417bc --- /dev/null +++ b/docs/installers.md @@ -0,0 +1,296 @@ +# Installers + +How Lemon Studio is installed on each platform, where it goes, and how installing fits with the updater. The release +workflow and the updater are in [releasing.md](releasing.md). The decisions here were made on 2026-11-29. + +## The rule everything follows + +**An installer runs once. Every update after that is the updater replacing the program file in place.** + +The program has a fixed path with no version in it, and every shortcut, menu entry and pin points at that path. An +update swaps the file at that path and touches nothing else. So a shortcut is made once, by the first install, and +nothing ever deletes or remakes it except uninstalling. That keeps pins on the taskbar, the Start menu, the Dock and +Linux launchers from being lost. + +| Platform | First install | Updates | +|---|---|---| +| Windows | `LemonStudio-Setup.exe` or `LemonStudio.msi` | The updater replaces `LemonStudio.exe` | +| Linux | `LemonStudio.AppImage` | The updater replaces the AppImage | +| macOS | `LemonStudio.dmg`, dragged to Applications | The updater replaces `Lemon Studio.app` (from the release's zip) | + +A nightly is a separate program with its own name everywhere: `LemonStudioNightly-Setup.exe`, `LemonStudioNightly.msi`, +`LemonStudioNightly.AppImage`, `LemonStudioNightly.dmg`, installed beside Lemon Studio rather than over it. The two can +be installed at the same time: each has its own folder, shortcuts, taskbar identity, install record and update +downloads, and installing, updating or uninstalling one never touches the other's. The only thing they share is the +plugins for other DAWs (below). + +Nothing is signed by a paid certificate on any platform (decided 2026-11-29). Windows shows SmartScreen's warning, and +macOS needs Open Anyway once. Updates the program installs itself don't ask again on either platform: the updater +downloads them itself, so they carry no downloaded-from-the-internet mark. + +## Where things go + +| | Program | Shortcuts and menu entries | Update downloads | +|---|---|---|---| +| Windows | `%LOCALAPPDATA%\Programs\Lemon Studio\LemonStudio.exe` | `Lemon Studio.lnk` in the Start menu (no folder), and on the desktop if chosen | `%LOCALAPPDATA%\Lemon Studio\Updates\` | +| Windows, nightly | `%LOCALAPPDATA%\Programs\Lemon Studio Nightly\LemonStudioNightly.exe` | `Lemon Studio Nightly.lnk` | as above | +| macOS | `/Applications/Lemon Studio.app`, or wherever the user put it | The Dock | `~/Library/Caches/Lemon Studio/Updates/` | +| Linux | `~/Applications/LemonStudio.AppImage`, or wherever the user put it | `~/.local/share/applications/lemonstudio.desktop` | `~/.cache/Lemon Studio/Updates/` | + +Settings, presets and the rest of the user folder stay where [os-paths](../crates/os-paths/src/lib.rs) puts them. +Installing and uninstalling never touch them. + +The plugins for other DAWs, when chosen, go to the per-user plugin folders that every DAW scans: + +| | VST3 | CLAP | +|---|---|---| +| Windows | `%LOCALAPPDATA%\Programs\Common\VST3` | `%LOCALAPPDATA%\Programs\Common\CLAP` | +| macOS | `~/Library/Audio/Plug-Ins/VST3` | `~/Library/Audio/Plug-Ins/CLAP` | +| Linux | `~/.vst3` | `~/.clap` | + +These are the folders `cargo run -p bundle-plugins -- --install` uses, so a build from source and an installed copy +agree on where the plugins are. + +### Keeping the paths good for later + +1. **No version in any path or file name** a shortcut or the updater uses. Major versions are not installed side by + side; an update replaces the one copy. +2. **The program is installed into a folder of its own**, though it is one file today, so files can be added beside it + later without moving it. +3. **Where it was installed is recorded**, and nothing assumes the default. Windows: + `HKEY_CURRENT_USER\Software\Lemon Studio\Install\`, with `Path` (the folder), `Installer` (`msi`, + or `exe` when the setup `.exe` ran it), `Layout` (1, the layout described here), and what was chosen: + `StartShortcut`, `DesktopShortcut` and `Plugins` (1 each when it was made or installed). Where the plugins went is in + `HKEY_CURRENT_USER\Software\Lemon Studio\Install\Plugins` (`VST3` and `CLAP`, the folders), shared by both + channels. A later version that has to change the layout reads `Layout` and moves what it must, but never the program + itself, whose path the shortcuts hold. +4. **Installs are per user.** No admin rights are asked for, by the installer or by an update, because the program's + folder belongs to the user. Installing for all users (Program Files) is not offered: an update would then need + admin rights. If it is ever added, such a copy leaves updating to whoever installed it. +5. **Each Windows channel has fixed identities**, used by every version and never changed: + + | | Stable | Nightly | + |---|---|---| + | MSI upgrade code | `{1E9F662A-4A65-471D-A243-3FC43C6EFC29}` | `{B37EF146-B0E5-4266-A040-028173A742D0}` | + | Setup `.exe` (bundle) upgrade code | `{C84F2340-EA3B-43D2-B7D3-8A86CC5C4A0C}` | `{2E4337A8-4755-406E-B644-58F9643D3A61}` | + | Program component | `{C5AADEFF-E231-4D3E-A9E2-B55A71B1464E}` | `{44068DC2-9981-4502-A64E-83FC6D56D1F0}` | + | Install record component | `{45717EBC-EEA2-4522-A673-470FB499D70C}` | `{88F97A45-6B9E-48DF-A2DD-D9030BADDAFA}` | + | Start menu shortcut component | `{6A57A2BE-D051-4916-AFB6-DF7DC1B939FA}` | `{4087233F-A4BF-4211-ADB7-9B59CB1ABAC0}` | + | Desktop shortcut component | `{95FB165E-97DE-4C70-92F9-8DFE15DBE1FE}` | `{992ED4D7-31CE-498F-AFA5-85D8B314781E}` | + | Plugins record component | `{AE8980C5-63FD-432B-A8B6-77CB26CAE1DD}` | `{816E19F3-B57C-4BAF-960A-2D4377D9F8F8}` | + | Taskbar identity (AppUserModelID) | `LemonStudio.LemonStudio` | `LemonStudio.LemonStudioNightly` | + + Shared by both: the plugin folders' record component, `{8A9CC1C5-FB3B-4CBE-B611-ED179163E89A}`, and the plugins' + own components, whose identities WiX makes from their paths. + +## Windows + +Both downloads come from one WiX project ([tools/package/windows](../tools/package/windows)): `LemonStudio.msi` is the +installer, and `LemonStudio-Setup.exe` is a WiX bundle that runs the same `.msi` behind a window of its own. Every rule +about files, shortcuts and upgrades is written once, in the `.msi`. + +A first install asks two things, both ticked to start with: + +- **Install the VST3 and CLAP plugins for other DAWs.** Lemon Studio has its plugins built in; these are for other + DAWs. +- **Add a shortcut to the desktop.** + +The Start menu shortcut is always made. On the command line they are `INSTALLPLUGINS` and `DESKTOPSHORTCUT` for the +`.msi` (`1` or `0`), `InstallPlugins` and `DesktopShortcut` for the setup `.exe`. + +An install over an installed copy (an update by hand, or the other installer) doesn't ask: it reads what was chosen +from the install record and keeps it. A plugin or desktop shortcut that was left out stays out. (Windows Installer on +its own would fall back to the defaults here, and so install the plugins the user had declined.) + +### The plugins, and plugins it didn't put there + +An installed plugin belongs to the `.msi` that installed it, and uninstalling removes it. So the installer is careful +about which plugins it takes on: + +- **Lemon plugins in the plugin folder already**, put there by something other than an installer (a `.zip`, or + `bundle-plugins --install` from a build): the plugins box starts unticked, with a note that ticking it replaces those + and removes them with Lemon Studio. Left unticked, the installer doesn't touch them. It tells by looking for one of + the release's CLAP plugins in the default CLAP folder, with no plugin record (below) saying an installer put it there. +- **Plugins installed by the other channel**: the box starts ticked, and the two share them. Windows Installer counts + the products using each plugin, so they stay until the last of the two is uninstalled. +- **Where they go** is recorded once, in `Install\Plugins`, by whichever installed them first. Every later run reads it + back, so a second channel, an update and an uninstall all use the same folders, even when the first install was told + other folders (`VST3FOLDER` and `CLAPFOLDER` on the `.msi`'s command line) and the later one wasn't. + +### Shortcuts that are never made again + +- The shortcuts are made by the first install only. Each is a plain shortcut to the program's path (never an + "advertised" MSI shortcut, which points at the MSI rather than the program), carrying the channel's AppUserModelID. + Lemon Studio sets the same ID on itself when it starts, so the taskbar treats its window, the shortcut and a pin as + one program, and a nightly and Lemon Studio as two. +- Each shortcut's component has a fixed identity, the same in every version, with a registry value under + `HKEY_CURRENT_USER\Software\Lemon Studio\Install\` as its key, and is marked never to be overwritten. A + later `.msi` run over an installed copy finds the value there and leaves the shortcut alone: not rewritten, and not + made again if the user deleted it. +- A newer `.msi` removes the older one only after it has installed itself (`MajorUpgrade` scheduled after + `InstallExecute`), so there is no moment when the shortcut's component belongs to nobody and is deleted. Deleting a + shortcut is what unpins it. +- Only uninstalling removes the shortcuts. +- Updates never run an installer at all. + +### Versions + +An MSI version is `major.minor.build`, with major and minor at most 255 and build at most 65535, so a nightly's dated +version can't be used as it is. The `.msi` and the setup `.exe` carry: + +- a tagged release: its version, `0.1.0` +- a nightly: `YY.MONTH.DAY×100+N`, so `2026.11.29.1` is `26.11.2901` (N at most 99) + +Both only go up. Stable and nightly versions are never compared: the channels have different upgrade codes. The +program itself keeps its real version, which is what Lemon Studio, the updater and the release show. + +After an update the program is newer than the `.msi` that installed it. That's fine: Windows Installer never replaces a +program with an older one, so repairing or rerunning an older `.msi` keeps the newer program, and a `.msi` older than +the installed one refuses to install. + +### What uninstalling does + +It removes the program, the shortcuts, the plugins it installed (from the recorded folders), the install record, and +what the updater leaves next to the program (`LemonStudio.exe.old`, `.LemonStudio.exe.new`). The user folder is kept. The plugins are shared by +Lemon Studio and its nightly when both installed them: they stay until the last of the two is uninstalled. + +### The look + +The installers are in Pith, the look of Lemon Studio's plugin editors and its website: a dark ground (`#2b2b2b`), grey +outlined cards, lemon (`#ffe066`) for what is on, Barlow and Cuprum type. + +A nightly's are set apart at a glance, so nobody takes one for a normal install: + +- Their windows are the night sky of the Nightly logo: its gradient, its moon and craters, and its stars, with night + blue cards and blue-grey quieter text, which reads better on it than Pith's greys. +- "Lemon Studio Nightly" is written with Nightly in lemon. +- The first page opens with "A nightly build: the newest changes, and the least tested." in lemon. +- The setup `.exe`, the program in Add and Remove Programs, and the `.dmg`'s volume all have the moon icon. + +The lemon buttons and check marks are the same as Lemon Studio's. The setup `.exe` uses one `theme.xml` for both: +build.sh gives a nightly's copy the night-blue colours, and Bundle.wxs sets `LemonNightly` for its first-page text. + +- **Setup `.exe`**: its whole window is ours: dark, with Lemon Studio's mark and name drawn in Cuprum and Barlow, light + text, and lemon buttons drawn as images. +- **`.msi`**: Windows Installer draws its own dialogs, so only part of them can be ours. The background art, the + text's colour and the layout are ours; the buttons and check boxes are Windows' own. Text other than the art is + Segoe UI, as Windows Installer and the setup window can only use fonts Windows has. + +The art is drawn by [tools/package/art.py](../tools/package/art.py) from the product's fonts and colours, and committed, +so a build needs no tools to make it. + +### Building them + +[build.sh](../tools/package/windows/build.sh) builds both, from the program, the plugins and a version. It needs WiX +6.0.2 (a .NET tool) with its Util and BootstrapperApplications extensions; the commands are at its top. WiX is pinned to +6.0.2 because WiX 7 makes everyone building with it accept its maintainers' licence first. + +Things about Windows Installer's and WiX's windows that cost time to find, so they aren't found again: + +- **`.msi` dialogs**: a control drawn over the full-window background picture is hidden unless the picture is in the + tab order (`TabSkip="no"`). Text in the grey `#ececec` (236) comes out black, so the text is white and `#e0e0e0`. + Windows Installer's own progress text (`ActionText`) ignores the text's style and comes out black, so it isn't used. + `REMOVE` isn't set yet when the last page shows after uninstalling, so the Remove button sets a property of its own. + A check box is ticked when its property has any value, `0` included, so `0` is made blank before the window shows. +- **Setup `.exe`** (WiX's standard window with our `theme.xml`): `Theme="none"` drops the theme and the window fails to + start, so it is `hyperlinkLicense` with our own theme in its place. A picture cut from the art sheet must end inside + the sheet, not at its edge, so the sheet has a pixel to spare. The window's style leaves out the system menu, or its + size is worked out as if it had a title bar. A check box's own words come out black whatever its font's colour, so + each box is only as wide as the box, and its words are a label beside it. +- **Testing on a machine with Lemon plugins installed**: give the `.msi` scratch folders (`VST3FOLDER=... + CLAPFOLDER=...`) on the first install. Every later run, uninstalling included, then uses them, and the real plugin + folders are never touched. Testing without them once took over a developer's installed plugins and then removed + them, which is what the rules above now prevent. + +## macOS + +`LemonStudio.dmg` opens a Finder window in Pith: `Lemon Studio.app` on the left, Applications on the right, an arrow +between them, and under them the steps to open it the first time: + +1. Drag Lemon Studio to Applications. +2. Open it. macOS says it can't check it: choose Done. +3. Open **System Settings ▸ Privacy & Security** and choose **Open Anyway** next to Lemon Studio. + +The window also has `How to open Lemon Studio.txt`, which has the same steps and the Terminal command that does the same +(`xattr -dr com.apple.quarantine "/Applications/Lemon Studio.app"`), to copy. Right-clicking and choosing Open no longer +gets past this on macOS 15 and later. + +The `.dmg` is made by [tools/package/dmg.sh](../tools/package/dmg.sh) with `hdiutil` and Finder's own window settings, +so it needs nothing installed beyond macOS. The plugins are not in the `.dmg`: macOS installs work by dragging, and +copying plugins into the plugin folders is a second step; Lemon Studio offers it at first start instead (below). + +The updater keeps downloading the release's zip, not the `.dmg`: the `.dmg` is only for the first install. + +Not yet tried on a Mac (the script was written on Windows); the first nightly's `.dmg` is where to check it: + +- **Finder draws the icons' names itself**, in its own colour: black in light mode, white in dark. No setting changes + that, so on the dark background the names may be hard to read in light mode. If they are, the wells under the icons + get a lighter strip where the names sit. +- **Finder lays the window out** on the build machine (AppleScript). Where it can't, the script still makes the `.dmg`, + with Finder's plain window, and warns; a release whose macOS build log shows that warning has a plain window. + +Ad hoc signing gives every build a different signature. macOS remembers permissions such as the microphone by +signature, so it may ask for the microphone again after each update. Signing with a certificate of the project's own +(free, still not notarized) would give every build the same identity; that is to be tried on a Mac before alpha. + +## Linux + +Lemon Studio is only an AppImage. It updates itself already (`$APPIMAGE` is what the updater replaces). On first start +it offers, once: + +- **to add itself to the applications menu**: it moves the AppImage to `~/Applications` (keeping its name) and writes + its desktop entry and icon to `~/.local/share`. It doesn't offer when the AppImage is already in `~/Applications`, or + when AppImageLauncher or Gear Lever look after it. +- **to install the VST3 and CLAP plugins for other DAWs** into `~/.vst3` and `~/.clap`. + +Updates replace the file at the same path, so the desktop entry, and any pin to it, never changes. + +## The updater, and what installing changes for it + +Done already: the updater checks the signed manifest, downloads this platform's file, checks its size and SHA-256, +replaces the program in place and starts it again ([releasing.md](releasing.md)). + +To do, before the first nightly goes out, because copies already out there keep the updater they were built with: + +- [ ] **A format number in the manifest.** An updater that meets a newer format says to download the update by hand + instead of misreading it. +- [ ] **More than one release key.** Every copy trusts the keys built into it. With a second, offline key built in, a + lost or leaked key can be replaced without stranding every installed copy. +- [ ] **Downloads in the local cache folders** above, not in the roaming `%APPDATA%` (Windows) or `~/.config`. +- [ ] **The Windows taskbar identity** (the AppUserModelID above) set by the program at start. +- [ ] **Add/Remove Programs shows the updated version.** After an update on Windows, the updater sets `DisplayVersion` + on the install's uninstall entry: the `.msi`'s, or the setup `.exe`'s when that is what installed it, found by their + upgrade codes. +- [ ] **The plugins are updated with the program.** When the install record (Windows), or a note in the user folder + (macOS, Linux), says the plugins were installed, the update replaces them too, from the release's plugin zip, which + the manifest then lists with its size and SHA-256. + +To do with the installers: + +- [ ] Linux: the first-start offers above. +- [ ] macOS: offer to move `Lemon Studio.app` to Applications when it is opened from the `.dmg` or from Downloads, + rather than only saying it can't update itself from there; and the plugins offer. + +## The website + +The download page offers, per platform, the installer: `LemonStudio-Setup.exe` (with the `.msi` beside it), the +`.dmg`, the AppImage. While the newest release is a nightly and there is no alpha yet, the nightly is the one offered. +Until a release has installers it falls back to that release's program files (`LemonStudio.exe`, the zip). The site +finds the files by these names, so renaming one means changing the site's `scripts/fetch-github-data.mjs` too. + +## Trying it + +On Windows, with the stable and the nightly `.msi` both: + +1. Install. Pin the program to Start and to the taskbar. +2. Install a newer `.msi` (or the setup `.exe`) of the same channel over it. The pins are still there, and the + shortcut's file is the one from step 1 (its creation time hasn't changed). +3. Delete the desktop shortcut and install a newer one again: the shortcut doesn't come back. +4. Uninstall: the program, the shortcuts and the plugins are gone; the user folder is not. +5. Install both channels with plugins, uninstall one: the plugins are still there. +6. Install without the desktop shortcut and without plugins, then install a newer one over it: neither appears. +7. With Lemon plugins copied into the plugin folder by hand, install: the plugins box starts unticked, with its note. + Leave it unticked, install, update and uninstall: the hand-copied plugins are unchanged. + +Steps 2 to 7 were checked on 2026-11-29, with the plugins going to scratch folders. Pins themselves weren't: step 2 +checks the shortcut file stays the same one, which is what keeps them. diff --git a/docs/releasing.md b/docs/releasing.md index 8da3b0ddd..5bcbad2a0 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -21,6 +21,10 @@ Each release has: - `LemonStudio--macos-aarch64.zip`, holding `Lemon Studio.app` (a nightly: `Lemon Studio Nightly.app`), signed ad hoc and not notarized - `LemonStudio-Plugins--.zip`: the VST3 and CLAP plugins for other DAWs, with a `README.txt` on where they go +- the installers, for a first install ([installers.md](installers.md)): `LemonStudio-Setup.exe` and `LemonStudio.msi` + (a nightly: `LemonStudioNightly-Setup.exe`, `LemonStudioNightly.msi`), built by + [tools/package/windows/build.sh](../tools/package/windows/build.sh) with the plugins in them; and `LemonStudio.dmg` + (`LemonStudioNightly.dmg`), built by [tools/package/dmg.sh](../tools/package/dmg.sh). The updater never uses them - `nightly.json` or `stable.json`, and its minisign signature (`.minisig`) - `LICENSE` and `THIRD-PARTY-NOTICES.txt` diff --git a/tools/package/art.py b/tools/package/art.py new file mode 100644 index 000000000..b28b29cca --- /dev/null +++ b/tools/package/art.py @@ -0,0 +1,364 @@ +# Copyright (C) 2026 ItsAlphaNeon +# SPDX-License-Identifier: GPL-3.0-or-later +# This file is part of Lemon Studio: https://github.com/ItsAlphaNeon/Lemon-Studio + +"""Draws the installers' art in Pith, Lemon Studio's look (docs/installers.md), for Lemon Studio and its nightly: + + python tools/package/art.py (from the repository root; needs Pillow) + +Writes, for each of `stable` and `nightly`: + + tools/package/windows/art//setup.png the setup .exe's window: its background, then its buttons' faces + (theme.xml takes them from here by position) + tools/package/windows/art//brand*.png the mark and name at the top of the window, at 1x, 1.5x and 2x + tools/package/windows/art//msi.bmp the .msi's dialogs' background (Windows Installer draws the rest) + tools/package/macos/art//background.png the .dmg's window, at 1x and 2x (background@2x.png) + +The art is committed, so a build needs none of this. Colours and fonts are the product's own (crates/os-ui/fonts, and +the Pith values in crates/os-ui/src/kit/lemon.rs); sizes match theme.xml, Package.wxs and dmg.sh, which say so where +they depend on them. + +The nightly's is set apart from Lemon Studio's at a glance: its windows are the night sky of its icon +(crates/os-app/assets/logo/logo-colored-lemon-nightly.svg), with its moon and stars, and the card the page sits in is +night blue. Pith's lemon stays for what is on. +""" + +import os + +from PIL import Image, ImageDraw, ImageFont + +ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) +FONTS = os.path.join(ROOT, "crates", "os-ui", "fonts") +LOGO = os.path.join(ROOT, "crates", "os-app", "assets", "logo") +OUT = os.path.join(ROOT, "tools", "package") + +# Pith +BG = "#2b2b2b" +PANEL = "#333333" +PANEL_LINE = "#232323" +WELL = "#1f1f1f" +WELL_LINE = "#181818" +FACE = "#464646" +FACE_HOVER = "#505050" +FACE_DOWN = "#3b3b3b" +FACE_LINE = "#232323" +STRIP = "#252525" +STRIP_LINE = "#1c1c1c" +TEXT = "#ececec" +DIM = "#a3a3a3" +FAINT = "#8a8a8a" +WORDMARK = "#8f8f8f" +LEMON = "#ffe066" +LEMON_HI = "#fff1b8" +LEMON_DEEP = "#c9a92c" +LEMON_INK = "#473900" +RED = "#ff6159" + +# The nightly's night sky: its icon's gradient (top to bottom here), moon, craters and stars. +SKY = [(0.0, "#0c0f2e"), (0.55, "#151b4b"), (1.0, "#262f78")] +SKY_CARD = "#181e4e" # theme.xml's check boxes and links are drawn on it: build.sh gives them this colour +SKY_LINE = "#2f3a8a" +SKY_WELL = "#0b0e29" +SKY_WELL_LINE = "#070920" +SKY_FACE, SKY_FACE_HOVER, SKY_FACE_DOWN = "#28306c", "#333c86", "#20275a" +SKY_STRIP = "#0a0d26" +# Text on it: Pith's greys are dull on night blue, so the nightly's quieter text is a light blue-grey instead (build.sh +# and UI.wxs give the installers' text these too). +SKY_DIM = "#c3c8ea" +SKY_FAINT = "#9da3cf" +MOON = "#f6f2df" +CRATER = "#d9d4ba" +STAR = "#fff4c2" + + +def font(name, size): + path = { + "brand": os.path.join(FONTS, "Cuprum", "Cuprum.ttf"), + "ui": os.path.join(FONTS, "Barlow", "BarlowSemiCondensed-Regular.ttf"), + "ui-bold": os.path.join(FONTS, "Barlow", "BarlowSemiCondensed-SemiBold.ttf"), + "cond": os.path.join(FONTS, "Barlow", "BarlowCondensed-Medium.ttf"), + }[name] + return ImageFont.truetype(path, size) + + +def hexrgb(c): + c = c.lstrip("#") + return tuple(int(c[i : i + 2], 16) for i in (0, 2, 4)) + + +def mix(a, b, t): + a, b = hexrgb(a), hexrgb(b) + return tuple(round(x + (y - x) * t) for x, y in zip(a, b)) + + +def mark(channel, size): + """The app's icon (the owner's bitmap), at `size` pixels square.""" + name = "icon-lemon-nightly.png" if channel == "nightly" else "icon-lemon.png" + return Image.open(os.path.join(LOGO, name)).convert("RGBA").resize((size, size), Image.LANCZOS) + + +class Canvas: + """Drawing at `s` times the art's size: everything is given in 1x units.""" + + def __init__(self, w, h, s=1, bg=BG): + self.s = s + self.im = Image.new("RGBA", (round(w * s), round(h * s)), bg) + self.d = ImageDraw.Draw(self.im) + + def px(self, v): + return round(v * self.s) + + def box(self, x, y, w, h): + return [self.px(x), self.px(y), self.px(x + w) - 1, self.px(y + h) - 1] + + def rect(self, x, y, w, h, fill, line=None, r=0): + self.d.rounded_rectangle(self.box(x, y, w, h), radius=self.px(r), fill=fill, outline=line, width=max(1, self.px(1)) if line else 0) + + def lit(self, x, y, w, h, top, bottom, line, r): + """The lit face: Pith's one gradient, top light to lemon.""" + face = Image.new("RGBA", (self.px(w), self.px(h))) + fd = ImageDraw.Draw(face) + for i in range(face.height): + fd.line([(0, i), (face.width, i)], fill=mix(top, bottom, i / max(1, face.height - 1))) + mask = Image.new("L", face.size, 0) + ImageDraw.Draw(mask).rounded_rectangle([0, 0, face.width - 1, face.height - 1], radius=self.px(r), fill=255) + self.im.paste(face, (self.px(x), self.px(y)), mask) + self.d.rounded_rectangle(self.box(x, y, w, h), radius=self.px(r), outline=line, width=max(1, self.px(1))) + + def text(self, x, y, s, f, size, fill, anchor="la"): + self.d.text((self.px(x), self.px(y)), s, font=font(f, self.px(size)), fill=fill, anchor=anchor) + + def width(self, s, f, size): + return self.d.textlength(s, font=font(f, self.px(size))) / self.s + + def paste(self, img, x, y): + self.im.alpha_composite(img, (self.px(x), self.px(y))) + + def sky(self, x, y, w, h): + """The nightly's ground: the night sky, dark at the top. Only up and down, so a strip of it looks the same + anywhere along a row (the setup window's buttons take their corners from it).""" + top, bottom = self.px(y), self.px(y + h) + for i in range(top, bottom): + t = (i - top) / max(1, bottom - top - 1) + for (t0, c0), (t1, c1) in zip(SKY, SKY[1:]): + if t <= t1: + col = mix(c0, c1, (t - t0) / (t1 - t0)) + break + self.d.line([(self.px(x), i), (self.px(x + w) - 1, i)], fill=col) + + def smooth(self, x, y, w, h, paint): + """Draws `paint(d, at, k)` with smooth edges: at four times the size, on a layer over x, y, w, h, then scaled + down onto the art. `at(a, b)` is where the 1x point a, b is on the layer, and `k` the layer's pixels a 1x unit.""" + X, Y = self.px(x), self.px(y) + W, H = max(1, self.px(x + w) - X), max(1, self.px(y + h) - Y) + k = 4 * self.s + layer = Image.new("RGBA", (W * 4, H * 4), (0, 0, 0, 0)) + paint(ImageDraw.Draw(layer), lambda a, b: ((a * self.s - X) * 4, (b * self.s - Y) * 4), k) + small = layer.convert("RGBa").resize((W, H), Image.LANCZOS).convert("RGBA") + self.im.alpha_composite(small, (X, Y)) + + def star(self, x, y, r, fill=STAR): + """One of the icon's four-pointed stars, `r` from its middle to a point.""" + k = r * 0.3 + pts = [(x, y - r), (x + k, y - k), (x + r, y), (x + k, y + k), (x, y + r), (x - k, y + k), (x - r, y), (x - k, y - k)] + self.smooth(x - r - 1, y - r - 1, 2 * r + 2, 2 * r + 2, lambda d, at, _: d.polygon([at(a, b) for a, b in pts], fill=fill)) + + def stars(self, at): + for x, y, r in at: + self.star(x, y, r) + + def moon(self, x, y, r): + """The icon's moon, with its craters and a faint glow, centred on x, y.""" + def paint(d, at, _): + def disc(cx, cy, e, fill): + d.ellipse([at(cx - e, cy - e), at(cx + e, cy + e)], fill=fill) + + # The glow, faint rings drawn one inside another, then the disc over them. + for i, a in enumerate((10, 16, 24)): + disc(x, y, r * (1.9 - i * 0.3), hexrgb(MOON) + (a,)) + disc(x, y, r, MOON) + for dx, dy, cr in ((0.26, -0.42, 0.2), (0.5, 0.3, 0.13), (-0.34, -0.06, 0.1), (-0.12, 0.48, 0.14)): + disc(x + dx * r, y + dy * r, cr * r, CRATER) + + e = r * 1.9 + 1 + self.smooth(x - e, y - e, 2 * e, 2 * e, paint) + + def brand(self, channel, x, y, size): + """The mark and the name beside it: "Lemon Studio", and "Nightly" in lemon for the nightly.""" + self.paste(mark(channel, self.px(size)), x, y) + tx = x + size + size * 0.33 + name_size = size * 0.72 + base = y + size * 0.5 + self.text(tx, base, "Lemon Studio", "brand", name_size, TEXT, "lm") + if channel == "nightly": + self.text(tx + self.width("Lemon Studio ", "brand", name_size), base, "Nightly", "brand", name_size, LEMON, "lm") + + +# --------------------------------------------------------------------------------------------- setup .exe (Burn) + +# theme.xml's window and controls, in its (1x) pixels. +WIN_W, WIN_H = 600, 380 +CARD = (16, 64, 568, 248) # x, y, w, h +BTN_W, BTN_H = 112, 32 +TITLE_W, TITLE_H = 36, 28 +BRAND = (20, 16, 32) # x, y, size of the mark +# Below the background in setup.png: the buttons' faces, a row each (normal, hover, pressed), at these x. +SHEET_Y = WIN_H +LIT_X, GREY_X, CLOSE_X = 0, BTN_W, 2 * BTN_W +# Then the progress bar's row: its 4 pixels at the left (the setup program reads the bar's whole width from the sheet, +# so the row is the sheet's width and the bar in theme.xml is narrower). +BAR_Y, BAR_H = WIN_H + 3 * BTN_H, 8 +SHEET_H = BAR_Y + BAR_H + + +def setup_sheet(channel): + # A pixel to spare on the right and at the bottom: the setup program wants every image to end inside the sheet. + night = channel == "nightly" + c = Canvas(WIN_W + 1, SHEET_H + 1) + # The window: its ground, a line round it, the outlined card the page sits in. The nightly's: the night sky, its + # moon beside the close button and stars round the edges, clear of the name and the buttons, and a night-blue card. + x, y, w, h = CARD + if night: + c.sky(0, 0, WIN_W, WIN_H) + c.d.rectangle(c.box(0, 0, WIN_W, WIN_H), outline=SKY_WELL_LINE) + c.moon(522, 32, 15) + c.stars([(352, 22, 3), (384, 44, 2), (418, 16, 4.5), (446, 40, 2.5), (474, 20, 3), (552, 50, 2.5), + (36, 340, 4), (74, 362, 2.5), (110, 330, 2), (150, 350, 3.5), (196, 366, 2)]) + c.rect(x, y, w, h, SKY_CARD, SKY_LINE, 10) + else: + c.rect(0, 0, WIN_W, WIN_H, BG, STRIP_LINE) + c.rect(x, y, w, h, PANEL, PANEL_LINE, 10) + # What is behind the buttons' rounded corners and the close button: the window's own ground where they sit (the + # Install button's place, and the close button's), which in the nightly's sky changes from row to row. + behind_btn = c.im.crop(c.box(WIN_W - 136 - BTN_W, WIN_H - 16 - BTN_H, BTN_W, BTN_H)) + behind_close = c.im.crop(c.box(WIN_W - TITLE_W, 0, TITLE_W, TITLE_H)) + face, face_hover, face_down = (SKY_FACE, SKY_FACE_HOVER, SKY_FACE_DOWN) if night else (FACE, FACE_HOVER, FACE_DOWN) + # Buttons: normal, hover, pressed, one row each. + for row, (lit_top, lit_bottom, grey, close) in enumerate( + [ + (LEMON_HI, LEMON, face, None), + ("#fff8dc", "#fff0a8", face_hover, RED), + (LEMON, LEMON_DEEP, face_down, "#d94f48"), + ] + ): + y = SHEET_Y + row * BTN_H + c.im.paste(behind_btn, (c.px(LIT_X), c.px(y))) + c.lit(LIT_X, y, BTN_W, BTN_H, lit_top, lit_bottom, LEMON_DEEP, 6) + c.im.paste(behind_btn, (c.px(GREY_X), c.px(y))) + c.rect(GREY_X, y, BTN_W, BTN_H, grey, SKY_WELL_LINE if night else FACE_LINE, 6) + # The window's close button (it has no title bar of its own): a cross, on red when pointed at. + c.im.paste(behind_close, (c.px(CLOSE_X), c.px(y))) + if close: + c.rect(CLOSE_X, y, TITLE_W, TITLE_H, close) + ink = TEXT if row else DIM + cx, cy = CLOSE_X + TITLE_W / 2, y + TITLE_H / 2 + c.d.line([c.px(cx - 5), c.px(cy - 5), c.px(cx + 5), c.px(cy + 5)], fill=ink, width=1) + c.d.line([c.px(cx - 5), c.px(cy + 5), c.px(cx + 5), c.px(cy - 5)], fill=ink, width=1) + # The progress bar: 4 pixels wide (theme.xml): edge, done, to do, edge. + for i, col in enumerate([WELL_LINE, LEMON, SKY_WELL if night else WELL, WELL_LINE]): + c.rect(i, BAR_Y, 1, BAR_H, col) + return c.im + + +def setup_brand(channel, scale): + """The mark and name, on the window's ground, for theme.xml's brand ImageControl (BRAND_W x BRAND_H).""" + c = Canvas(BRAND_W, BRAND_H, scale) + if channel == "nightly": + # The stretch of sky it covers, so it sits in the sky without a seam. + c.sky(-BRAND[0], -BRAND[1], WIN_W, WIN_H) + c.brand(channel, 0, 0, BRAND[2]) + return c.im + + +BRAND_W, BRAND_H = 300, 32 + + +# --------------------------------------------------------------------------------------------- .msi dialogs + +# Package.wxs's dialogs are 370 x 270 dialog units; the bitmap is drawn at 4/3 pixels a unit (Segoe UI 9). +MSI_W, MSI_H = 493, 360 +MSI_U = MSI_W / 370 + + +def msi_background(channel): + c = Canvas(MSI_W, MSI_H) + u = MSI_U + # The page's card, and the strip the buttons sit on (Windows draws the buttons). The nightly's: the night sky, its + # moon and stars, clear of the name, the title and the buttons, and a night-blue card. + if channel == "nightly": + c.sky(0, 0, MSI_W, MSI_H) + c.moon(MSI_W - 34, 29, 13) + c.stars([(300, 18, 2.5), (330, 40, 3.5), (362, 14, 2), (392, 34, 4), (420, 50, 2)]) + c.rect(10 * u, 44 * u, 350 * u, 186 * u, SKY_CARD, SKY_LINE, 8) + c.rect(0, 238 * u, MSI_W, MSI_H - 238 * u, SKY_STRIP) + c.rect(0, 238 * u, MSI_W, 1, SKY_LINE) + c.stars([(30, 336, 3.5), (64, 352, 2), (98, 330, 2.5), (140, 348, 3), (180, 334, 2)]) + else: + c.rect(10 * u, 44 * u, 350 * u, 186 * u, PANEL, PANEL_LINE, 8) + c.rect(0, 238 * u, MSI_W, MSI_H - 238 * u, STRIP) + c.rect(0, 238 * u, MSI_W, 1, STRIP_LINE) + c.brand(channel, 14 * u, 12 * u, 22 * u) + return c.im.convert("RGB") + + +# --------------------------------------------------------------------------------------------- .dmg window + +# dmg.sh's window and icon places, in Finder's points. +DMG_W, DMG_H = 660, 440 +DMG_ICON_Y = 190 +DMG_APP_X, DMG_APPS_X = 170, 490 + + +def dmg_background(channel, scale): + night = channel == "nightly" + c = Canvas(DMG_W, DMG_H, scale) + if night: + # The night sky, its moon and stars, clear of the icons, their names and the note (dmg.sh puts it at 596, 54). + c.sky(0, 0, DMG_W, DMG_H) + c.moon(486, 44, 18) + c.stars([(370, 30, 3), (404, 62, 4.5), (440, 22, 2.5), (530, 76, 2.5), (330, 92, 2), (36, 96, 3), + (90, 82, 2), (628, 150, 3.5), (612, 262, 2.5), (40, 250, 2.5), (22, 180, 4)]) + c.brand(channel, 28, 24, 30) + well, well_line = (SKY_WELL, SKY_LINE) if night else (WELL, WELL_LINE) + # The drag: two wells the icons sit on, a lemon arrow between them. + for x in (DMG_APP_X, DMG_APPS_X): + c.rect(x - 74, DMG_ICON_Y - 74, 148, 168, well, well_line, 10) + ay = DMG_ICON_Y + c.d.line([c.px(DMG_APP_X + 92), c.px(ay), c.px(DMG_APPS_X - 100), c.px(ay)], fill=LEMON, width=c.px(4)) + tip = DMG_APPS_X - 90 + c.d.polygon([(c.px(tip), c.px(ay)), (c.px(tip - 16), c.px(ay - 11)), (c.px(tip - 16), c.px(ay + 11))], fill=LEMON) + c.text(DMG_W / 2, ay - 26, "Drag to Applications", "ui-bold", 15, TEXT, "ms") + # Opening it the first time: the steps past Gatekeeper. + app = "Lemon Studio Nightly" if channel == "nightly" else "Lemon Studio" + x, y, w, h = 28, 300, DMG_W - 56, 116 + c.rect(x, y, w, h, SKY_CARD if night else PANEL, SKY_LINE if night else PANEL_LINE, 10) + c.text(x + 18, y + 14, "Opening it the first time", "cond", 19, TEXT) + steps = [ + f"1. Open {app} from Applications. macOS says it can't check it: choose Done.", + "2. Open System Settings, then Privacy & Security, and choose Open Anyway.", + "3. Updates install themselves after that, without asking again.", + ] + for i, s in enumerate(steps): + c.text(x + 18, y + 46 + i * 21, s, "ui", 14.5, SKY_DIM if night else DIM) + return c.im.convert("RGB") + + +def save(im, *parts): + path = os.path.join(OUT, *parts) + os.makedirs(os.path.dirname(path), exist_ok=True) + im.save(path) + print(os.path.relpath(path, ROOT).replace(os.sep, "/"), im.size) + + +def main(): + for channel in ("stable", "nightly"): + save(setup_sheet(channel), "windows", "art", channel, "setup.png") + for scale, suffix in ((1, ""), (1.5, "@1.5x"), (2, "@2x")): + save(setup_brand(channel, scale), "windows", "art", channel, f"brand{suffix}.png") + save(msi_background(channel), "windows", "art", channel, "msi.bmp") + save(dmg_background(channel, 1), "macos", "art", channel, "background.png") + save(dmg_background(channel, 2), "macos", "art", channel, "background@2x.png") + + +if __name__ == "__main__": + main() diff --git a/tools/package/dmg.sh b/tools/package/dmg.sh new file mode 100755 index 000000000..e4461ebc8 --- /dev/null +++ b/tools/package/dmg.sh @@ -0,0 +1,122 @@ +#!/usr/bin/env bash +# Copyright (C) 2026 ItsAlphaNeon +# SPDX-License-Identifier: GPL-3.0-or-later +# This file is part of Lemon Studio: https://github.com/ItsAlphaNeon/Lemon-Studio + +# Packs Lemon Studio's .app as the macOS download (docs/installers.md): a .dmg that opens a Finder window in Pith, the +# app on the left, Applications on the right, an arrow between them and, under them, how to open it the first time. +# +# tools/package/dmg.sh [nightly] +# +# Needs only macOS: hdiutil makes the disk image, and Finder lays out its window (AppleScript), which stores the layout +# in the image's .DS_Store. The art is tools/package/art.py's, kept in the repository (macos/art/), drawn for a +# window of 660 x 440 points with the icons at (170, 190) and (490, 190): change those there and here together. +# +# Finder lays the window out only where it can run: on a Mac with someone logged in, or a CI runner, which has Finder. +# Where it can't, the .dmg is still made, with Finder's plain window, and a warning says so. +set -euo pipefail + +if [ $# -lt 2 ] || [ $# -gt 3 ]; then + echo "usage: $0 [nightly]" >&2 + exit 2 +fi +app=$1 +out=$2 +channel=stable +[ "${3:-}" = nightly ] && channel=nightly +name="Lemon Studio" +[ "$channel" = nightly ] && name="Lemon Studio Nightly" +here=$(cd "$(dirname "$0")" && pwd) +art=$here/macos/art/$channel +appname=$(basename "$app") + +work=$(mktemp -d) +mnt="" +cleanup() { + [ -n "$mnt" ] && hdiutil detach "$mnt" -quiet -force 2>/dev/null || true + rm -rf "$work" +} +trap cleanup EXIT + +# What the window holds. Names starting with a dot are hidden by Finder. +stage=$work/stage +mkdir -p "$stage/.background" +ditto "$app" "$stage/$appname" +ln -s /Applications "$stage/Applications" +# One picture for both kinds of screen: Finder picks the 2x one on a Retina screen. +tiffutil -cathidpicheck "$art/background.png" "$art/background@2x.png" -out "$stage/.background/background.tiff" >/dev/null +icns=$(find "$app/Contents/Resources" -maxdepth 1 -name '*.icns' | head -n 1) +[ -n "$icns" ] && cp "$icns" "$stage/.VolumeIcon.icns" +cat >"$stage/How to open $name.txt" </dev/null; then + SetFile -a C "$mnt" +fi + +# The window: no toolbar, the background, the icons on their wells and the note top right, out of the drag's way. The +# bounds are the window's frame, so its height is the picture's plus Finder's title bar. +layout() { + osascript <&2 +fi +# Finder writes the .DS_Store when it gets round to it. +for _ in 1 2 3 4 5 6 7 8 9 10; do [ -f "$mnt/.DS_Store" ] && break; sleep 1; done +chmod -Rf go-w "$mnt" || true +sync +hdiutil detach "$mnt" -quiet || { sleep 3; hdiutil detach "$mnt" -quiet -force; } +mnt="" + +rm -f "$out" +hdiutil convert -quiet "$rw" -format UDZO -imagekey zlib-level=9 -o "$out" +echo "$out" diff --git a/tools/package/macos/art/nightly/background.png b/tools/package/macos/art/nightly/background.png new file mode 100644 index 000000000..8881d9583 Binary files /dev/null and b/tools/package/macos/art/nightly/background.png differ diff --git a/tools/package/macos/art/nightly/background@2x.png b/tools/package/macos/art/nightly/background@2x.png new file mode 100644 index 000000000..7e005824c Binary files /dev/null and b/tools/package/macos/art/nightly/background@2x.png differ diff --git a/tools/package/macos/art/stable/background.png b/tools/package/macos/art/stable/background.png new file mode 100644 index 000000000..a5361c851 Binary files /dev/null and b/tools/package/macos/art/stable/background.png differ diff --git a/tools/package/macos/art/stable/background@2x.png b/tools/package/macos/art/stable/background@2x.png new file mode 100644 index 000000000..3d0cc38a7 Binary files /dev/null and b/tools/package/macos/art/stable/background@2x.png differ diff --git a/tools/package/release-notes.md b/tools/package/release-notes.md index a05a324c9..4d4bbdcd2 100644 --- a/tools/package/release-notes.md +++ b/tools/package/release-notes.md @@ -2,25 +2,25 @@ ### Downloads -| | Lemon Studio | Its plugins for other DAWs (VST3 and CLAP) | -|---|---|---| -| Windows | `{PROGRAM}.exe` | `LemonStudio-Plugins-{VERSION}-windows-x86_64.zip` | -| Linux | `{PROGRAM}.AppImage` | `LemonStudio-Plugins-{VERSION}-linux-x86_64.zip` | -| macOS (Apple silicon) | `LemonStudio-{VERSION}-macos-aarch64.zip` | `LemonStudio-Plugins-{VERSION}-macos-aarch64.zip` | +| | Install it | Or just the program | Its plugins for other DAWs (VST3 and CLAP) | +|---|---|---|---| +| Windows | `{PROGRAM}-Setup.exe` (or `{PROGRAM}.msi`) | `{PROGRAM}.exe` | `LemonStudio-Plugins-{VERSION}-windows-x86_64.zip` | +| Linux | `{PROGRAM}.AppImage` | | `LemonStudio-Plugins-{VERSION}-linux-x86_64.zip` | +| macOS (Apple silicon) | `{PROGRAM}.dmg` | `LemonStudio-{VERSION}-macos-aarch64.zip` | `LemonStudio-Plugins-{VERSION}-macos-aarch64.zip` | -Lemon Studio has its own plugins built in; the plugin downloads are for using them in other DAWs. Once installed, Lemon -Studio checks for updates when it starts (Settings ▸ General ▸ Updates) and installs them itself, under the same file -name, so shortcuts to it keep working. +Lemon Studio has its own plugins built in; the plugin downloads are for using them in other DAWs. The Windows +installers offer to install them too. Once installed, Lemon Studio checks for updates when it starts (Settings ▸ +General ▸ Updates) and installs them itself, under the same file name, so shortcuts and pins keep working. -- **Windows:** run the `.exe`. It isn't signed, so SmartScreen may say it doesn't recognise it: choose **More info** ▸ - **Run anyway**. +- **Windows:** run `{PROGRAM}-Setup.exe`. It installs for you only and needs no administrator rights. It isn't + signed, so SmartScreen may say it doesn't recognise it: choose **More info** ▸ **Run anyway**. The `.msi` installs + the same way, for those who'd rather have one. - **Linux:** make the AppImage executable (`chmod +x {PROGRAM}.AppImage`, or in its file properties) and run it. -- **macOS:** Lemon Studio is not notarized by Apple (that needs a paid Apple Developer account the project doesn't have), - so macOS stops it the first time. Unzip it and move **{APP}.app** to Applications. Then open it once, go to - **System Settings ▸ Privacy & Security** and choose **Open Anyway** (on macOS 14 and earlier, right-click the app ▸ - **Open** ▸ **Open** also works). Or, in Terminal: - `xattr -dr com.apple.quarantine "/Applications/{APP}.app"`. Updates Lemon Studio installs itself don't ask - again. +- **macOS:** open the `.dmg` and drag **{APP}** to Applications. Lemon Studio is not notarized by Apple (that needs a + paid Apple Developer account the project doesn't have), so macOS stops it the first time: open it once, go to + **System Settings ▸ Privacy & Security** and choose **Open Anyway**. Or, in Terminal: + `xattr -dr com.apple.quarantine "/Applications/{APP}.app"`. The `.dmg` has these steps in it too. Updates Lemon + Studio installs itself don't ask again. - **Plugins:** unzip and copy the `VST3` folder's contents to your VST3 folder and the `CLAP` folder's to your CLAP folder (the zip's `README.txt` lists where those are). On macOS, also run `xattr -dr com.apple.quarantine` on the copied plugins, or DAWs won't load them. diff --git a/tools/package/windows/Bundle.wxs b/tools/package/windows/Bundle.wxs new file mode 100644 index 000000000..00c3bd6c2 --- /dev/null +++ b/tools/package/windows/Bundle.wxs @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/package/windows/Package.wxs b/tools/package/windows/Package.wxs new file mode 100644 index 000000000..5d9d16702 --- /dev/null +++ b/tools/package/windows/Package.wxs @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/package/windows/UI.wxs b/tools/package/windows/UI.wxs new file mode 100644 index 000000000..26626310c --- /dev/null +++ b/tools/package/windows/UI.wxs @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/package/windows/art/nightly/brand.png b/tools/package/windows/art/nightly/brand.png new file mode 100644 index 000000000..a8b5dc2cd Binary files /dev/null and b/tools/package/windows/art/nightly/brand.png differ diff --git a/tools/package/windows/art/nightly/brand@1.5x.png b/tools/package/windows/art/nightly/brand@1.5x.png new file mode 100644 index 000000000..00ba220f6 Binary files /dev/null and b/tools/package/windows/art/nightly/brand@1.5x.png differ diff --git a/tools/package/windows/art/nightly/brand@2x.png b/tools/package/windows/art/nightly/brand@2x.png new file mode 100644 index 000000000..4640013ee Binary files /dev/null and b/tools/package/windows/art/nightly/brand@2x.png differ diff --git a/tools/package/windows/art/nightly/msi.bmp b/tools/package/windows/art/nightly/msi.bmp new file mode 100644 index 000000000..1493fddbb Binary files /dev/null and b/tools/package/windows/art/nightly/msi.bmp differ diff --git a/tools/package/windows/art/nightly/setup.png b/tools/package/windows/art/nightly/setup.png new file mode 100644 index 000000000..17f6b2e27 Binary files /dev/null and b/tools/package/windows/art/nightly/setup.png differ diff --git a/tools/package/windows/art/stable/brand.png b/tools/package/windows/art/stable/brand.png new file mode 100644 index 000000000..341560c26 Binary files /dev/null and b/tools/package/windows/art/stable/brand.png differ diff --git a/tools/package/windows/art/stable/brand@1.5x.png b/tools/package/windows/art/stable/brand@1.5x.png new file mode 100644 index 000000000..ae2c8a98e Binary files /dev/null and b/tools/package/windows/art/stable/brand@1.5x.png differ diff --git a/tools/package/windows/art/stable/brand@2x.png b/tools/package/windows/art/stable/brand@2x.png new file mode 100644 index 000000000..5c7dc3a29 Binary files /dev/null and b/tools/package/windows/art/stable/brand@2x.png differ diff --git a/tools/package/windows/art/stable/msi.bmp b/tools/package/windows/art/stable/msi.bmp new file mode 100644 index 000000000..05b2734f7 Binary files /dev/null and b/tools/package/windows/art/stable/msi.bmp differ diff --git a/tools/package/windows/art/stable/setup.png b/tools/package/windows/art/stable/setup.png new file mode 100644 index 000000000..fc82fef75 Binary files /dev/null and b/tools/package/windows/art/stable/setup.png differ diff --git a/tools/package/windows/build.sh b/tools/package/windows/build.sh new file mode 100755 index 000000000..fa4c537a4 --- /dev/null +++ b/tools/package/windows/build.sh @@ -0,0 +1,92 @@ +#!/usr/bin/env bash +# Copyright (C) 2026 ItsAlphaNeon +# SPDX-License-Identifier: GPL-3.0-or-later +# This file is part of Lemon Studio: https://github.com/ItsAlphaNeon/Lemon-Studio + +# Builds Lemon Studio's Windows installers (docs/installers.md): the .msi (Package.wxs, UI.wxs) and the setup .exe +# that runs it (Bundle.wxs, theme.xml). Needs WiX 6.0.2 and its Util and BootstrapperApplications extensions: +# +# dotnet tool install --global wix --version 6.0.2 +# wix extension add -g WixToolset.Util.wixext/6.0.2 WixToolset.BootstrapperApplications.wixext/6.0.2 +# +# (WiX 7 asks for its maintainers' licence to be accepted; 6.0.2 doesn't.) The art is tools/package/art.py's, kept in +# the repository. +# +# build.sh +# +# holds VST3/ and CLAP/ (the release workflow's plugins folder). Writes /LemonStudio.msi and +# /LemonStudio-Setup.exe (a nightly's: LemonStudioNightly.msi, LemonStudioNightly-Setup.exe). +set -euo pipefail + +if [ $# -ne 5 ]; then + echo "usage: $0 " >&2 + exit 2 +fi +program=$1 version=$2 channel=$3 plugins=$4 out=$5 +here=$(cd "$(dirname "$0")" && pwd) +root=$(cd "$here/../../.." && pwd) + +case "$channel" in + stable) base=LemonStudio icon="$root/crates/os-app/assets/lemonstudio.ico" ;; + nightly) base=LemonStudioNightly icon="$root/crates/os-app/assets/lemonstudio-nightly.ico" ;; + *) echo "channel must be stable or nightly, not $channel" >&2; exit 2 ;; +esac + +# Windows Installer compares the first three numbers of a version, each at most 255.255.65535. A tagged release's +# version (0.1.0) is one as it is. A nightly's YEAR.MONTH.DAY.N becomes YY.MONTH.(DAY*100+N): 2026.11.29.1 is +# 26.11.2901, so each nightly's is higher than the one before (N stays under 100). +if [ "$channel" = nightly ]; then + IFS=. read -r y m d n <<<"$version" + if [ -z "${n:-}" ] || [ "$n" -ge 100 ]; then + echo "a nightly's version is YEAR.MONTH.DAY.N with N under 100, not $version" >&2 + exit 2 + fi + msiversion="$((y % 100)).$((10#$m)).$((10#$d * 100 + n))" +else + msiversion=${version%%[-+]*} +fi + +# One of the CLAP plugins, which the installers look for to tell whether Lemon plugins are installed already. +probe=$(cd "$plugins/CLAP" && ls -1 | head -n 1) +if [ -z "$probe" ]; then + echo "no CLAP plugins in $plugins/CLAP" >&2 + exit 2 +fi + +# WiX is a Windows program: give it Windows paths. +win() { if command -v cygpath >/dev/null; then cygpath -w "$1"; else echo "$1"; fi; } + +mkdir -p "$out" +out=$(cd "$out" && pwd) +art="$here/art/$channel" +work=$(mktemp -d) +trap 'rm -rf "$work"' EXIT + +# The setup .exe's look. A nightly's card is night blue (art.py's SKY_CARD), and the check boxes and links are drawn on +# it, so their background is that colour; its quieter text is art.py's SKY_DIM and SKY_FAINT, which read better on it +# than Pith's greys. (theme.xml's colours are blue, green, red.) +theme="$here/theme.xml" +if [ "$channel" = nightly ]; then + sed -e 's/Background="333333"/Background="4e1e18"/g' \ + -e 's/Foreground="a3a3a3"/Foreground="eac8c3"/g' -e 's/Foreground="8a8a8a"/Foreground="cfa39d"/g' \ + "$theme" >"$work/theme.xml" + theme="$work/theme.xml" +fi + +# The program goes in under its own name, LemonStudio(Nightly).exe; Package.wxs names it. +wix build -arch x64 -ext WixToolset.Util.wixext \ + -d Channel="$channel" -d Version="$version" -d MsiVersion="$msiversion" \ + -d ProgramFile="$(win "$program")" -d Plugins="$(win "$plugins")" -d Probe="$probe" -d Art="$(win "$art")" -d Icon="$(win "$icon")" \ + -intermediatefolder "$(win "$work/msi")" \ + -o "$(win "$out/$base.msi")" \ + "$(win "$here/Package.wxs")" "$(win "$here/UI.wxs")" + +wix build -arch x64 -ext WixToolset.Util.wixext -ext WixToolset.BootstrapperApplications.wixext \ + -d Channel="$channel" -d Version="$version" -d Msi="$(win "$out/$base.msi")" -d Probe="$probe" -d Art="$(win "$art")" -d Icon="$(win "$icon")" -d Theme="$(win "$theme")" \ + -bindpath "$(win "$here")" \ + -intermediatefolder "$(win "$work/exe")" \ + -o "$(win "$out/$base-Setup.exe")" \ + "$(win "$here/Bundle.wxs")" + +rm -f "$out/$base.wixpdb" "$out/$base-Setup.wixpdb" +echo "built $out/$base.msi and $out/$base-Setup.exe ($version, as $msiversion for Windows Installer)" diff --git a/tools/package/windows/theme.wxl b/tools/package/windows/theme.wxl new file mode 100644 index 000000000..83d6e80e4 --- /dev/null +++ b/tools/package/windows/theme.wxl @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/package/windows/theme.xml b/tools/package/windows/theme.xml new file mode 100644 index 000000000..037ecd603 --- /dev/null +++ b/tools/package/windows/theme.xml @@ -0,0 +1,193 @@ + + + + Segoe UI + Segoe UI + Segoe UI + Segoe UI + Segoe UI + Segoe UI + Segoe UI + Segoe UI + Segoe UI + + + + + + + + + + + + + + + + + + + + + + + + + + + + #(loc.PluginsCheckbox) + + + #(loc.DesktopCheckbox) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #(loc.FailureLogText) + + + + + + +