Skip to content
This repository was archived by the owner on Nov 23, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/package-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,41 @@ jobs:
python3 tools/package-setup-platform.py --release-dir build/release-artifacts
cd build/release-artifacts
shasum -a 256 -c SHA256SUMS.txt
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: moader-v4-staged-assets
path: build/release-artifacts/*
if-no-files-found: error
compression-level: 0
retention-days: 7

windows-icon:
name: Embed Windows app icon and seal release assets
needs: package
runs-on: windows-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.12'
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: moader-v4-staged-assets
path: build/release-artifacts
- name: Download pinned Windows resource editor
shell: pwsh
run: |
New-Item -ItemType Directory -Force build/rcedit | Out-Null
Invoke-WebRequest 'https://github.com/electron/rcedit/releases/download/v2.0.0/rcedit-x64.exe' -OutFile build/rcedit/rcedit-x64.exe
$actual = (Get-FileHash build/rcedit/rcedit-x64.exe -Algorithm SHA256).Hash.ToLowerInvariant()
if ($actual -ne '3e7801db1a5edbec91b49a24a094aad776cb4515488ea5a4ca2289c400eade2a') { throw 'Pinned rcedit checksum differs' }
- name: Embed icon and verify final assets
shell: pwsh
run: |
python tools/finalize-windows-setup-icon.py --release-dir build/release-artifacts --rcedit build/rcedit/rcedit-x64.exe
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: moader-v4-release-assets
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## v4.0.0 — Setup and in-app updates

- Package the separate prebuilt Setup apps with a rounded version of the existing hbmenu icon on macOS, Linux and Windows.

- Publish five self-contained, prebuilt **Moader Setup** app downloads for macOS, Linux and Windows with WSL2. GitHub Actions packages each OS and architecture separately. The smaller backend ZIP retains the command-line tools and matched native files. Setup guides host preparation, SD copying, connection checks and support export using the existing checked installers.
- Add **Settings → Updates** to the console app for manual checks and optional checks at launch and every six hours. Updates verify both app and resident downloads before installation and can resume after interruption.
- Match the Setup window to Moader's console and browser theme. Keep the pinned kaiHEN and Seedsow A/B components. The new Setup and update flows have host validation; the exact v4.0.0 release pair and desktop kit have no Switch 2 installation result. [Release notes](docs/releases/v4.0.0.md).
Expand Down
1 change: 1 addition & 0 deletions branding/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Two offset game cartridges form the Moader mark. The front cartridge has a clipp
| [store.svg](store.svg) | A 24 × 24 shopping bag with cartridge contacts. The Store control uses this silhouette in gray while inactive. |
| [hbmenu-source.svg](hbmenu-source.svg) | Square icon artwork with a `#17231D` mark on a `#9CF4CE` ground. |
| [hbmenu.jpg](hbmenu.jpg) | Opaque 256 × 256 RGB icon embedded in the foreground NRO. |
| [setup-icon.svg](setup-icon.svg), [setup-icon.png](setup-icon.png), and [setup-icon.ico](setup-icon.ico) | Rounded version of the same hbmenu artwork for the desktop Setup window, macOS Dock, Linux launcher and Windows icon. The square console icon stays unchanged. |
| [mark-alpha.hpp](mark-alpha.hpp) | Generated masks for the native renderer, including the 96 × 96 mark, two 348 × 69 lockup layers and the Store glyph. |
| [favicon.svg](favicon.svg) and [web/icon.svg](../web/icon.svg) | Square browser icon exports. The web interface also uses this artwork when a cover is unavailable. |

Expand Down
3 changes: 3 additions & 0 deletions branding/checks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"store.svg": "38e2b43138564830c2145db8d75d44aaea6cb1d2ff8cd9f89bbefdf8bbf16a76",
"hbmenu-source.svg": "9f37bff231ad3581d02dc0950c45d95d146d62d00d99b225f489da70b6d32325",
"hbmenu.jpg": "3c94c519c8ae931c4af076c27229da59bba226125831229f6f12535ff3e9205a",
"setup-icon.svg": "05303b68e4dfcf0801136d4061b8b656fb1c76143527acf326c4857fc7015002",
"setup-icon.png": "2268d60c1f65d91fbda8e0cb34a867dfa8e3904dd504725b54424d03cc7c6db4",
"setup-icon.ico": "6f4ce00e0ee575c673e60f32e2f86e98a14f7aba61051382616c5e1fb128106a",
"mark-alpha.hpp": "be860805171bbfc8559f4d56b8b7069b3bde0229076113538c3dd629ea8be9cc",
"favicon.svg": "9f37bff231ad3581d02dc0950c45d95d146d62d00d99b225f489da70b6d32325"
}
17 changes: 17 additions & 0 deletions branding/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ def main():
(ROOT.parent / "web/icon.svg").write_text(icon)
img = raster(icon, 256, 256).convert("RGB")
img.save(ROOT / "hbmenu.jpg", quality=96, subsampling=0, progressive=False)
# Keep the console hbmenu icon square; the desktop app gets rounded mint corners.
rounded = icon.replace(
'<rect width="256" height="256" fill="#9CF4CE"/>',
'<rect width="256" height="256" rx="52" fill="#9CF4CE"/>',
)
if rounded == icon:
raise ValueError("hbmenu icon background changed; update the Setup icon recipe")
(ROOT / "setup-icon.svg").write_text(rounded)
setup_icon = raster(rounded, 1024, 1024)
setup_icon.save(ROOT / "setup-icon.png")
setup_icon.save(ROOT / "setup-icon.ico", format="ICO", sizes=[
(16, 16), (24, 24), (32, 32), (48, 48), (64, 64),
(128, 128), (256, 256),
])
art = ET.fromstring((ROOT / "lockup.svg").read_text())

def layer(ink):
Expand Down Expand Up @@ -101,6 +115,9 @@ def layer(ink):
"store.svg",
"hbmenu-source.svg",
"hbmenu.jpg",
"setup-icon.svg",
"setup-icon.png",
"setup-icon.ico",
"mark-alpha.hpp",
"favicon.svg",
]
Expand Down
Binary file added branding/setup-icon.ico
Binary file not shown.
Binary file added branding/setup-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions branding/setup-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/MAINTAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ For a matching release checkout, audit and commit the source before packaging:
python3 tools/package-release.py
```

The base packager reads the source from `HEAD`, verifies the component proof and checks the exported public tree. It writes the app and backend ZIPs, binaries, and an intermediate universal Setup ZIP. `tools/package-setup-platform.py` turns that intermediate into five prebuilt, self-contained OS apps, ad hoc signs the macOS bundles, and writes the final manifest and checksums. The universal intermediate is not a public release asset. Use an empty output directory. Review the final bytes before release and record the source commit with the downloads. When refreshing assets on an existing tag, retain the tag and disclose that the ZIP source commit differs from GitHub's automatic source archives.
The base packager reads the source from `HEAD`, verifies the component proof and checks the exported public tree. It writes the app and backend ZIPs, binaries, and an intermediate universal Setup ZIP. `tools/package-setup-platform.py` turns that intermediate into five prebuilt, self-contained OS apps, embeds the rounded hbmenu icon in the macOS bundles, ad hoc signs them, and writes an intermediate manifest and checksums. The Windows workflow step embeds the matching ICO in the executable and seals the final manifest and checksums. The universal intermediate is not a public release asset. Use an empty output directory. Review the final bytes before release and record the source commit with the downloads. When refreshing assets on an existing tag, retain the tag and disclose that the ZIP source commit differs from GitHub's automatic source archives.

## Native changes

Expand All @@ -71,7 +71,7 @@ When changing runtime log layout, keep `include/moader/runtime_log_wire.h`, the

## Verify the exported artifacts

Moader Setup uses a local controller, a dedicated Electron desktop window, pinned Node 24 executables for macOS/Linux arm64/x86_64, and uv for kit-scoped Python. `tools/package-release.py` verifies the official Node, uv and Electron runtime archives and includes their license notices. `tools/package-setup-platform.py` assembles each native executable with the matched backend inside the app's resources. Keep `setup/desktop-app/`, `setup/host-policy.cjs`, `setup/host-tools.cjs`, `setup/launch.sh`, `setup/windows-launch.ps1`, `setup/wsl-entry.sh`, `setup/licenses/` and `docs/SETUP_GUI.md` in public source. Do not commit `host-runtimes/` binaries to Git; the packager adds them to the OS downloads. The command-line backend ZIP omits the Setup app and its runtimes. The dedicated `.github/workflows/package-setup.yml` workflow stages only checksum-qualified native inputs from the existing backend release asset, packages all five apps on a macOS runner and exports the final assets for review. Public macOS distribution still needs project signing and notarization. Test an extracted platform Setup ZIP by opening its app from a moved folder, including a path with spaces or non-ASCII characters, and by inspecting its support export. Preserve the CLI fallback and the existing native proof gates.
Moader Setup uses a local controller, a dedicated Electron desktop window, pinned Node 24 executables for macOS/Linux arm64/x86_64, and uv for kit-scoped Python. `tools/package-release.py` verifies the official Node, uv and Electron runtime archives and includes their license notices. `tools/package-setup-platform.py` assembles each native executable with the matched backend inside the app's resources. Keep `setup/desktop-app/`, `setup/host-policy.cjs`, `setup/host-tools.cjs`, `setup/launch.sh`, `setup/windows-launch.ps1`, `setup/wsl-entry.sh`, `setup/licenses/` and `docs/SETUP_GUI.md` in public source. Do not commit `host-runtimes/` binaries to Git; the packager adds them to the OS downloads. The command-line backend ZIP omits the Setup app and its runtimes. The dedicated `.github/workflows/package-setup.yml` workflow stages only checksum-qualified native inputs from the existing backend release asset, packages all five apps on a macOS runner, embeds the Windows executable icon on a Windows runner, and exports the final assets for review. Public macOS distribution still needs project signing and notarization. Test an extracted platform Setup ZIP by opening its app from a moved folder, including a path with spaces or non-ASCII characters, and by inspecting its support export. Preserve the CLI fallback and the existing native proof gates.

Run `node --test setup/test-controller.cjs` against matched kit inputs for host-only token, restart, uncertainty, SD-export, hash and redaction checks. Use `tools/test-ns2jb-host.py --online --node /absolute/path/to/node24` for the existing source-qualified SmileBASIC path. Keep host-only and actual-console results in separate validation headings.

Expand Down
2 changes: 1 addition & 1 deletion docs/releases/v4.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Five separate **Moader Setup** downloads provide prebuilt desktop apps for macOS

[Installation](../INSTALLATION.md) · [Moader Setup guide](../SETUP_GUI.md) · [In-app updates](../USAGE.md#update-the-app-and-resident-plugin) · [Seedsow standalone requirements](../SEEDSOW_STANDALONE.md)

The v4.0.0 assets were refreshed after the tag to make the command-line backend smaller and provide separate prebuilt Setup apps. GitHub Actions packages the five OS and architecture downloads. The release manifest records the exact source commit for the refreshed ZIPs. The standalone Moader A route still needs an exact qualified local FS capture. The public kit does not contain that console-derived capture or its payload. The pinned kaiHEN RO, HEN, regular bootstrap and standalone bootstrap retain their recorded identities. The macOS desktop apps have ad hoc signatures and are not notarized; consult the [Setup guide](../SETUP_GUI.md#platform-and-release-limits) before using it on a quarantined download.
The v4.0.0 assets were refreshed after the tag to make the command-line backend smaller and provide separate prebuilt Setup apps. GitHub Actions packages the five OS and architecture downloads with a rounded version of Moader's hbmenu icon. The release manifest records the exact source commit for the refreshed ZIPs. The standalone Moader A route still needs an exact qualified local FS capture. The public kit does not contain that console-derived capture or its payload. The pinned kaiHEN RO, HEN, regular bootstrap and standalone bootstrap retain their recorded identities. The macOS desktop apps have ad hoc signatures and are not notarized; consult the [Setup guide](../SETUP_GUI.md#platform-and-release-limits) before using it on a quarantined download.

## Validation scope

Expand Down
2 changes: 1 addition & 1 deletion setup/controller.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const uiFiles = new Map([
['/', ['setup/ui/index.html', 'text/html; charset=utf-8']],
['/style.css', ['setup/ui/style.css', 'text/css; charset=utf-8']],
['/app.js', ['setup/ui/app.js', 'text/javascript; charset=utf-8']],
['/favicon.svg', ['branding/favicon.svg', 'image/svg+xml']],
['/favicon.svg', ['branding/setup-icon.svg', 'image/svg+xml']],
['/lockup.svg', ['branding/lockup.svg', 'image/svg+xml']],
['/font/text.ttf', ['native/assets/Text.ttf', 'font/ttf']],
['/font/strong.ttf', ['native/assets/Strong.ttf', 'font/ttf']]
Expand Down
2 changes: 1 addition & 1 deletion setup/desktop-app/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {app, BrowserWindow, dialog, Menu, shell} = require('electron');
const packagedKit = path.join(process.resourcesPath, 'kit');
const usesPackagedKit = fs.existsSync(path.join(packagedKit, 'config/release.json'));
const kit = usesPackagedKit ? packagedKit : path.resolve(__dirname, '../..');
const logo = path.join(kit, 'branding/mark-alpha.png');
const logo = path.join(kit, 'branding/setup-icon.png');
app.setName('Moader Setup');
if (process.platform === 'darwin') Menu.setApplicationMenu(Menu.buildFromTemplate([
{label: 'Moader Setup', submenu: [{role: 'about'}, {type: 'separator'},
Expand Down
110 changes: 110 additions & 0 deletions tools/finalize-windows-setup-icon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#!/usr/bin/env python3
"""Embed the rounded Setup icon in the prebuilt Windows EXE and reseal assets."""
from pathlib import Path, PurePosixPath
import argparse
import copy
import hashlib
import json
import subprocess
import tempfile
import zipfile

RCEDIT_SHA256 = '3e7801db1a5edbec91b49a24a094aad776cb4515488ea5a4ca2289c400eade2a'


def sha(path):
digest = hashlib.sha256()
with path.open('rb') as stream:
for block in iter(lambda: stream.read(1024 * 1024), b''):
digest.update(block)
return digest.hexdigest()


def require(ok, message):
if not ok:
raise ValueError(message)


def starts_with(path, prefix):
with path.open('rb') as stream:
return stream.read(len(prefix)) == prefix


def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--release-dir', required=True, type=Path)
parser.add_argument('--rcedit', required=True, type=Path)
args = parser.parse_args()
directory = args.release_dir.resolve()
tool = args.rcedit.resolve()
require(tool.is_file() and sha(tool) == RCEDIT_SHA256,
'Pinned rcedit-x64.exe checksum differs')
manifest_path = directory / 'release-manifest.json'
manifest = json.loads(manifest_path.read_text())
require(manifest['tag'] == 'v4.0.0', 'Unexpected release for Windows icon update')
name = manifest['setupGuiAssets']['windows-x64']
path = directory / name
record = manifest['assets'][name]
require(path.is_file() and path.stat().st_size == record['bytes'] and
sha(path) == record['sha256'], 'Windows Setup archive differs from the manifest')
prefix = f'Moader-Setup-{manifest["tag"]}-windows-x64/'
exe_name = prefix + 'Moader Setup.exe'
ico_name = prefix + 'resources/kit/branding/setup-icon.ico'
with tempfile.TemporaryDirectory(prefix='moader-setup-windows-icon-',
dir=directory) as temp_name:
temp = Path(temp_name)
exe = temp / 'Moader Setup.exe'
ico = temp / 'setup-icon.ico'
revised = temp / name
with zipfile.ZipFile(path) as original:
require(original.testzip() is None, 'Windows Setup ZIP has a CRC error')
names = original.namelist()
require(len(names) == len(set(names)) and exe_name in names and ico_name in names,
'Windows Setup EXE or rounded icon is missing')
for member in names:
part = PurePosixPath(member)
require(member.startswith(prefix) and not part.is_absolute() and
'..' not in part.parts, 'Unsafe Windows Setup ZIP member')
exe.write_bytes(original.read(exe_name))
ico.write_bytes(original.read(ico_name))
require(starts_with(exe, b'MZ') and starts_with(ico, b'\x00\x00\x01\x00'),
'Invalid Windows executable or icon format')
previous = sha(exe)
subprocess.run([str(tool), str(exe), '--set-icon', str(ico)], check=True)
require(starts_with(exe, b'MZ') and sha(exe) != previous,
'Windows executable icon was not updated')
with zipfile.ZipFile(revised, 'w', compression=zipfile.ZIP_DEFLATED,
compresslevel=9) as updated:
for info in original.infolist():
data = exe.read_bytes() if info.filename == exe_name else original.read(info)
updated.writestr(copy.copy(info), data)
with zipfile.ZipFile(revised) as verified:
require(verified.testzip() is None and verified.namelist() == names and
verified.read(exe_name) == exe.read_bytes(),
'Windows Setup ZIP failed post-icon readback')
revised.replace(path)
manifest['assets'][name] = {'bytes': path.stat().st_size, 'sha256': sha(path)}
manifest['windowsIconEmbedded'] = True
manifest_path.write_text(json.dumps(manifest, indent=2) + '\n')
checksums = directory / 'SHA256SUMS.txt'
listed = [f'Moader-{manifest["tag"]}.zip', f'Moader-backend-{manifest["tag"]}.zip',
*manifest['setupGuiAssets'].values(), 'Moader.nro', 'moader.nso',
'release-manifest.json']
require(set(listed) == set(manifest['assets']) | {'release-manifest.json'},
'Final release asset list differs from the manifest')
checksums.write_text(''.join(sha(directory / item) + ' ' + item + '\n' for item in listed))
for item in listed:
asset = directory / item
require(asset.is_file(), 'Final release asset is missing: ' + item)
if item in manifest['assets']:
record = manifest['assets'][item]
require(asset.stat().st_size == record['bytes'] and sha(asset) == record['sha256'],
'Final release asset differs from manifest: ' + item)
print('Embedded the rounded Windows EXE icon and verified final release checksums')


if __name__ == '__main__':
try:
main()
except (OSError, ValueError, subprocess.CalledProcessError) as error:
raise SystemExit('Windows icon packaging stopped: ' + str(error))
Loading