Improve Linux desktop identity packaged builds #1201
main fromrefs/pull/1201/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
- scripts/build-desktop-artifact.ts lines 661 to 665OutdatedResolvedby Chrono-byte(GitHub profile, opens in a new tab)@@ -648,3 +658,8 @@648658 yield* runCommand(649659 ChildProcess.make({650660 cwd: stageAppDir,661+ env: {662+ ...process.env,663+ BUN_TMPDIR: stageBunTmpDir,664+ BUN_INSTALL: stageBunInstallDir,665+ },
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
- apps/desktop/scripts/dev-electron.mjs lines 58 to 61OutdatedResolvedby Chrono-byte(GitHub profile, opens in a new tab)@@ -57,4 +58,4 @@57585859 const app = spawn(5960 resolveElectronPath(),60- [`--t3code-dev-root=${desktopDir}`, "dist-electron/main.js"],61+ [...linuxClassArg, `--t3code-dev-root=${desktopDir}`, "dist-electron/main.js"],
Noojuno(GitHub profile, opens in a new tab) approved these changes
binbandit(GitHub profile, opens in a new tab) approved these changes
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:S
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:XXL
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:S
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
- @@ -795,10 +826,19 @@795826 }796827797828 isQuitting = true;829+ updateInstallInFlight = true;798830 clearUpdatePollTimer();799831 try {800832 await stopBackendAndWaitForExit();801- autoUpdater.quitAndInstall();802- return { accepted: true, completed: true };833+ // Destroy all windows before launching the NSIS installer to avoid the installer finding live windows it needs to close.834+ for (const win of BrowserWindow.getAllWindows()) {835+ win.destroy();836+ }837+ // `quitAndInstall()` only starts the handoff to the updater. The actual838+ // install may still fail asynchronously, so keep the action incomplete839+ // until we either quit or receive an updater error.840+ autoUpdater.quitAndInstall(true, true);841+ return { accepted: true, completed: false };803842 } catch (error: unknown) {804843 const message = formatErrorMessage(error);844+ updateInstallInFlight = false;
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:XXL
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
juliusmarminge approved these changes
juliusmarminge merged this0a88719
juliusmarminge closed this
Sign in to join this conversation.


📝 Walkthrough
Walkthrough#
The changes configure the Linux desktop application identity by explicitly setting the WM class and desktop entry name through Electron APIs and electron-builder configuration. A new type alias supports the optional
setDesktopNamecall, and constants define the desktop entry name and WM class used across development and production builds. The staged package metadata is also updated to reflect the normalized application name.Changes#
apps/desktop/src/main.ts,scripts/build-desktop-artifact.tsLinuxDesktopNamedApptype alias for optionalsetDesktopNamemethod. Updated staged package name and build configuration to use consistent "t3code" identifier across development and production environments.Estimated code review effort#
🎯 2 (Simple) | ⏱️ ~10 minutes
Poem#
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (2 passed)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share