[PR #282] [MERGED] fix(launcher): unblock pre-#277 users + auto-repair icon path #4544

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

📋 Pull Request Information

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

Base: main ← Head: fix/launcher-migration-pathing-and-conflict


📝 Commits (2)

  • e39471c fix(launcher): correct installDir resolution and unblock auto-update
  • bf46632 fix(launcher): unblock stuck pre-#277 users by removing root app-icon.ico

📊 Changes

3 files changed (+52 additions, -3 deletions)

View changed files

➖ app-icon.ico (+0 -0)
📝 packages/server/src/app.ts (+2 -1)
📝 packages/server/src/services/setup/taskbar-shortcut-migration.ts (+50 -2)

📄 Description

Summary

Follow-up to #277 — fixes two bugs that are stranding existing users at pre-#277 HEAD with no manual labor required for any user category.

The two bugs

  1. installDir off-by-one in app.ts (silent migration skip). Resolving the install root walked 4 levels up from dist/ instead of 3, so the migration looked for MarinaraLauncher.exe one directory too high, didn't find it, and silently skipped. Fixed by using 3 levels.

  2. Tracked app-icon.ico at repo root collides with the installer's untracked copy. The original installer wrote a byte-identical app-icon.ico into $INSTDIR as an untracked file. #277 then committed app-icon.ico at the repo root, so git merge --ff-only in start.bat refuses to overwrite it and the auto-update silently fails — every existing user is stranded on the pre-#277 commit forever (their OLD start.bat also lacks any cleanup, so they can't even pull a fix). This is the core problem.

The cure (and why it works for everyone)

This PR removes app-icon.ico from the repo root entirely and points the migration at installer/app-icon.ico instead — the installer subfolder is always tracked, but at a path the original installer never touched, so no collision is possible.

For a user stranded at pre-#277 HEAD:

  • The merge target tree (this PR's HEAD) doesn't track app-icon.ico at the root.
  • Their starting tree (pre-#277) also doesn't track it.
  • git merge --ff-only only diffs old-tree → new-tree, sees no change at that path, leaves the untracked file alone, FF succeeds. (Verified in a synthetic git repo before opening this PR.)

For a user who already pulled #277 / #278 successfully: their app-icon.ico is tracked in HEAD, so the FF will delete it. Their already-migrated .lnk would then have a broken IconLocation. Self-heal added — if a .lnk already targets the launcher but its IconLocation file no longer exists, the migration auto-repairs it on the next server boot. No user action.

For brand-new installer installs: the existing installer still writes $INSTDIR\app-icon.ico (untracked, byte-identical) so the pre-migration shortcut shows the right icon immediately, and the migration sources from installer/app-icon.ico so future updates never collide. No installer change needed.

What's in this PR

  • packages/server/src/app.ts: 4→3 levels resolving installDir.
  • packages/server/src/services/setup/taskbar-shortcut-migration.ts: source icon from installer/app-icon.ico, add self-heal for broken IconLocation on already-migrated shortcuts.
  • start.bat: drop the (now-redundant) app-icon.ico cleanup block — with the file no longer tracked at root, no collision can occur.
  • app-icon.ico: removed from repo root.

Manual verification

  • On a pre-#277 install with the original untracked $INSTDIR\app-icon.ico present, run start.bat → git merge --ff-only succeeds → server boots → migration runs → Start Menu shortcut now targets MarinaraLauncher.exe with IconLocation = ...\installer\app-icon.ico,0.
  • On an already-migrated install (currently pointing at $INSTDIR\app-icon.ico), pull this PR → app-icon.ico is removed from working tree → re-launch via shortcut → migration self-heals the IconLocation to installer/app-icon.ico → icon renders correctly.
  • Right-click migrated Start Menu shortcut → Pin to taskbar → click → console groups under the pinned icon.
  • Re-run start.bat twice in a row — second run is a no-op (idempotent).
  • Non-Windows host → migration skips silently.

No linked issue. Recommend treating as a hotfix — the bug shipped in #277 is currently silently breaking auto-update for the entire existing user base.

Summary by CodeRabbit

  • Bug Fixes
    • Improved taskbar shortcut migration to automatically detect and repair broken icon references.
    • Taskbar shortcuts targeting the launcher are now updated if their icon paths become invalid.

🔄 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/282 **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:** `fix/launcher-migration-pathing-and-conflict` --- ### 📝 Commits (2) - [`e39471c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e39471c77555c417d0cecaa1dceaf0e9695a4fce) fix(launcher): correct installDir resolution and unblock auto-update - [`bf46632`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bf466322b4e8275cc5419fb728fbd7559330ed77) fix(launcher): unblock stuck pre-#277 users by removing root app-icon.ico ### 📊 Changes **3 files changed** (+52 additions, -3 deletions) <details> <summary>View changed files</summary> ➖ `app-icon.ico` (+0 -0) 📝 `packages/server/src/app.ts` (+2 -1) 📝 `packages/server/src/services/setup/taskbar-shortcut-migration.ts` (+50 -2) </details> ### 📄 Description ## Summary Follow-up to #277 — fixes two bugs that are stranding existing users at pre-#277 HEAD with **no manual labor required for any user category**. ### The two bugs 1. **`installDir` off-by-one in `app.ts`** (silent migration skip). Resolving the install root walked 4 levels up from `dist/` instead of 3, so the migration looked for `MarinaraLauncher.exe` one directory too high, didn't find it, and silently skipped. Fixed by using 3 levels. 2. **Tracked `app-icon.ico` at repo root collides with the installer's untracked copy**. The original installer wrote a byte-identical `app-icon.ico` into `$INSTDIR` as an untracked file. #277 then committed `app-icon.ico` at the repo root, so `git merge --ff-only` in `start.bat` refuses to overwrite it and the auto-update silently fails — every existing user is stranded on the pre-#277 commit forever (their OLD `start.bat` also lacks any cleanup, so they can't even pull a fix). This is the core problem. ### The cure (and why it works for everyone) This PR removes `app-icon.ico` from the repo root entirely and points the migration at `installer/app-icon.ico` instead — the installer subfolder is always tracked, but at a path the original installer never touched, so no collision is possible. For a user stranded at pre-#277 HEAD: - The merge target tree (this PR's HEAD) doesn't track `app-icon.ico` at the root. - Their starting tree (pre-#277) also doesn't track it. - `git merge --ff-only` only diffs `old-tree → new-tree`, sees no change at that path, leaves the untracked file alone, FF succeeds. (Verified in a synthetic git repo before opening this PR.) For a user who already pulled #277 / #278 successfully: their `app-icon.ico` is tracked in HEAD, so the FF will delete it. Their already-migrated `.lnk` would then have a broken `IconLocation`. **Self-heal added** — if a `.lnk` already targets the launcher but its `IconLocation` file no longer exists, the migration auto-repairs it on the next server boot. No user action. For brand-new installer installs: the existing installer still writes `$INSTDIR\app-icon.ico` (untracked, byte-identical) so the pre-migration shortcut shows the right icon immediately, and the migration sources from `installer/app-icon.ico` so future updates never collide. No installer change needed. ### What's in this PR - `packages/server/src/app.ts`: 4→3 levels resolving `installDir`. - `packages/server/src/services/setup/taskbar-shortcut-migration.ts`: source icon from `installer/app-icon.ico`, add self-heal for broken IconLocation on already-migrated shortcuts. - `start.bat`: drop the (now-redundant) `app-icon.ico` cleanup block — with the file no longer tracked at root, no collision can occur. - `app-icon.ico`: removed from repo root. ## Manual verification - [ ] On a pre-#277 install with the original untracked `$INSTDIR\app-icon.ico` present, run `start.bat` → `git merge --ff-only` succeeds → server boots → migration runs → Start Menu shortcut now targets `MarinaraLauncher.exe` with `IconLocation = ...\installer\app-icon.ico,0`. - [ ] On an already-migrated install (currently pointing at `$INSTDIR\app-icon.ico`), pull this PR → `app-icon.ico` is removed from working tree → re-launch via shortcut → migration self-heals the IconLocation to `installer/app-icon.ico` → icon renders correctly. - [ ] Right-click migrated Start Menu shortcut → Pin to taskbar → click → console groups under the pinned icon. - [ ] Re-run `start.bat` twice in a row — second run is a no-op (idempotent). - [ ] Non-Windows host → migration skips silently. No linked issue. Recommend treating as a hotfix — the bug shipped in #277 is currently silently breaking auto-update for the entire existing user base. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved taskbar shortcut migration to automatically detect and repair broken icon references. * Taskbar shortcuts targeting the launcher are now updated if their icon paths become invalid. <!-- 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:35 +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#4544
No description provided.