[PR #277] [MERGED] feat(launcher): pinnable taskbar shortcut via custom launcher exe #4543

Closed
opened 2026-10-22 04:08:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/277
Author: @LukaTheHero
Created: 4/28/2026
Status: ✅ Merged
Merged: 4/28/2026
Merged by: @LukaTheHero

Base: main ← Head: feat/taskbar-launcher-migration


📝 Commits (1)

  • 93f30cf feat(launcher): pinnable taskbar shortcut via custom launcher exe

📊 Changes

6 files changed (+326 additions, -0 deletions)

View changed files

➕ MarinaraLauncher.exe (+0 -0)
➕ app-icon.ico (+0 -0)
📝 packages/server/src/app.ts (+12 -0)
➕ packages/server/src/services/setup/taskbar-shortcut-migration.ts (+134 -0)
➕ tools/win-launcher/Program.cs (+160 -0)
➕ tools/win-launcher/build.ps1 (+20 -0)

📄 Description

Summary

Existing Marinara Engine shortcuts target start.bat, which Windows 10/11 refuses to pin to the taskbar. Even bypassing that, console windows spawned by cmd.exe don't reliably group under custom pinned icons (Windows treats cmd as a system app and ignores per-shortcut AppUserModelIDs).

This PR adds a tiny Win32 launcher (MarinaraLauncher.exe, ~6 KB) and a one-time startup migration that re-points the Start Menu and Desktop shortcuts at the launcher, stamping a stable AUMID (Pasta-Devs.MarinaraEngine) on the .lnk file.

After this lands, the Start Menu shortcut becomes drag/right-click pinnable to the taskbar, and clicking it launches the engine in a console that groups under the pinned icon — the icon used in the Start Menu carries through unchanged.

How it works

  • tools/win-launcher/Program.cs — Win32-subsystem .NET 4 app. Two modes:
    • Default: sets the process AUMID via SetCurrentProcessExplicitAppUserModelID before AllocConsole, so the console window is born with the AUMID. Then spawns cmd /k <start.bat> inheriting that console.
    • --stamp-lnk <path> <aumid>: writes the AUMID property onto an existing .lnk via IShellLink + IPropertyStore.
  • packages/server/src/services/setup/taskbar-shortcut-migration.ts — Windows-only, idempotent. Only touches shortcuts whose current target is this install's start.bat; skips ones already pointing at the launcher.
  • packages/server/src/app.ts — fire-and-forget call after seed steps.
  • MarinaraLauncher.exe + app-icon.ico committed at repo root so existing users receive them via git pull on next start.

No installer changes — the existing installer continues to work for new users; the migration takes care of them on first launch.

Manual verification

  • Pull this branch into an existing Marinara install dir, run start.bat, watch the server start successfully.
  • Confirm MarinaraLauncher.exe and app-icon.ico are present in the install root after pull.
  • Inspect the migrated Start Menu shortcut — Target should be <INSTDIR>\MarinaraLauncher.exe, Arguments should be Pasta-Devs.MarinaraEngine \"...start.bat\" \"Marinara Engine\", AUMID should be stamped on the .lnk (verifiable via IPropertyStore read).
  • Right-click the migrated Start Menu shortcut → Pin to taskbar.
  • Click the pinned icon → console window launches under the pinned icon (not as a separate generic cmd entry).
  • Restart the engine via the pinned icon a second time → second window groups under the same icon.
  • Run on a non-Windows host (Linux/macOS) and confirm the migration silently skips with no errors.

Notes

  • No linked issue. If maintainers want one tracked, please open a feature request before merge.
  • MarinaraLauncher.exe is checked in as a binary (~6 KB). tools/win-launcher/build.ps1 rebuilds it from source using the .NET Framework 4 csc.exe shipped with every Win10/11 — no external toolchain required.
  • The migration honors a debug env var MARINARA_LAUNCHER_TEST_LNKS (semicolon-delimited extra .lnk paths) so the behavior can be tested without touching the user's real Start Menu shortcut.

Summary by CodeRabbit

Release Notes

  • New Features

    • Automatic migration of user shortcuts to the new launcher during startup, supporting Start Menu and Desktop shortcuts on Windows.
    • New Windows launcher executable with enhanced task bar integration and window management capabilities.
  • Chores

    • Added build tooling for Windows launcher compilation.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/277 **Author:** [@LukaTheHero](https://github.com/LukaTheHero) **Created:** 4/28/2026 **Status:** ✅ Merged **Merged:** 4/28/2026 **Merged by:** [@LukaTheHero](https://github.com/LukaTheHero) **Base:** `main` ← **Head:** `feat/taskbar-launcher-migration` --- ### 📝 Commits (1) - [`93f30cf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/93f30cf3084a631ea8047ffe56e19334af6b42b9) feat(launcher): pinnable taskbar shortcut via custom launcher exe ### 📊 Changes **6 files changed** (+326 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `MarinaraLauncher.exe` (+0 -0) ➕ `app-icon.ico` (+0 -0) 📝 `packages/server/src/app.ts` (+12 -0) ➕ `packages/server/src/services/setup/taskbar-shortcut-migration.ts` (+134 -0) ➕ `tools/win-launcher/Program.cs` (+160 -0) ➕ `tools/win-launcher/build.ps1` (+20 -0) </details> ### 📄 Description ## Summary Existing Marinara Engine shortcuts target `start.bat`, which Windows 10/11 refuses to pin to the taskbar. Even bypassing that, console windows spawned by `cmd.exe` don't reliably group under custom pinned icons (Windows treats cmd as a system app and ignores per-shortcut AppUserModelIDs). This PR adds a tiny Win32 launcher (`MarinaraLauncher.exe`, ~6 KB) and a one-time startup migration that re-points the Start Menu and Desktop shortcuts at the launcher, stamping a stable AUMID (`Pasta-Devs.MarinaraEngine`) on the `.lnk` file. After this lands, the Start Menu shortcut becomes drag/right-click pinnable to the taskbar, and clicking it launches the engine in a console that groups **under** the pinned icon — the icon used in the Start Menu carries through unchanged. ## How it works - **`tools/win-launcher/Program.cs`** — Win32-subsystem .NET 4 app. Two modes: - Default: sets the process AUMID via `SetCurrentProcessExplicitAppUserModelID` *before* `AllocConsole`, so the console window is born with the AUMID. Then spawns `cmd /k <start.bat>` inheriting that console. - `--stamp-lnk <path> <aumid>`: writes the AUMID property onto an existing `.lnk` via `IShellLink` + `IPropertyStore`. - **`packages/server/src/services/setup/taskbar-shortcut-migration.ts`** — Windows-only, idempotent. Only touches shortcuts whose current target is *this* install's `start.bat`; skips ones already pointing at the launcher. - **`packages/server/src/app.ts`** — fire-and-forget call after seed steps. - **`MarinaraLauncher.exe` + `app-icon.ico`** committed at repo root so existing users receive them via `git pull` on next start. No installer changes — the existing installer continues to work for new users; the migration takes care of them on first launch. ## Manual verification - [ ] Pull this branch into an existing Marinara install dir, run `start.bat`, watch the server start successfully. - [ ] Confirm `MarinaraLauncher.exe` and `app-icon.ico` are present in the install root after pull. - [ ] Inspect the migrated Start Menu shortcut — `Target` should be `<INSTDIR>\MarinaraLauncher.exe`, `Arguments` should be `Pasta-Devs.MarinaraEngine \"...start.bat\" \"Marinara Engine\"`, AUMID should be stamped on the `.lnk` (verifiable via `IPropertyStore` read). - [ ] Right-click the migrated Start Menu shortcut → Pin to taskbar. - [ ] Click the pinned icon → console window launches **under** the pinned icon (not as a separate generic cmd entry). - [ ] Restart the engine via the pinned icon a second time → second window groups under the same icon. - [ ] Run on a non-Windows host (Linux/macOS) and confirm the migration silently skips with no errors. ## Notes - No linked issue. If maintainers want one tracked, please open a feature request before merge. - `MarinaraLauncher.exe` is checked in as a binary (~6 KB). `tools/win-launcher/build.ps1` rebuilds it from source using the .NET Framework 4 `csc.exe` shipped with every Win10/11 — no external toolchain required. - The migration honors a debug env var `MARINARA_LAUNCHER_TEST_LNKS` (semicolon-delimited extra `.lnk` paths) so the behavior can be tested without touching the user's real Start Menu shortcut. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Automatic migration of user shortcuts to the new launcher during startup, supporting Start Menu and Desktop shortcuts on Windows. * New Windows launcher executable with enhanced task bar integration and window management capabilities. * **Chores** * Added build tooling for Windows launcher compilation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:08:34 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4543
No description provided.