From 70c9fd77f60b5a2f8110b9447bb8262744d1ce3c Mon Sep 17 00:00:00 2001 From: DhanushSantosh Date: Thu, 26 Feb 2026 11:20:03 +0530 Subject: [PATCH] fix: correct production icon path and refresh icon cache on RPM install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - icon-manager.ts: fix production path from '../dist/public' to '../dist' Vite copies public/ assets to the root of dist/, not dist/public/, so the old path caused electronAppExists() to return null in packaged builds — falling through to Electron's default icon in the taskbar - rpm-after-install.sh: add gtk-update-icon-cache and update-desktop-database so GNOME/KDE picks up the installed icon and desktop entry immediately without a session restart Co-Authored-By: Claude Sonnet 4.6 --- apps/ui/scripts/rpm-after-install.sh | 12 ++++++++++-- apps/ui/src/electron/utils/icon-manager.ts | 4 +++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/ui/scripts/rpm-after-install.sh b/apps/ui/scripts/rpm-after-install.sh index 06f59500..ee4d9550 100644 --- a/apps/ui/scripts/rpm-after-install.sh +++ b/apps/ui/scripts/rpm-after-install.sh @@ -1,6 +1,14 @@ #!/bin/bash # Set the setuid bit on chrome-sandbox so Electron's sandbox works on systems # where unprivileged user namespaces are restricted (e.g. hardened kernels). -# On Fedora/RHEL with standard kernel settings this is not strictly required, -# but it is a safe no-op when not needed. +# On Fedora/RHEL with standard kernel settings this is a safe no-op. chmod 4755 /opt/Automaker/chrome-sandbox 2>/dev/null || true + +# Refresh the GTK icon cache so GNOME/KDE picks up the newly installed icon +# immediately without requiring a logout. The -f flag forces a rebuild even +# if the cache is up-to-date; -t suppresses the mtime check warning. +gtk-update-icon-cache -f -t /usr/share/icons/hicolor 2>/dev/null || true + +# Rebuild the desktop entry database so the app appears in the app launcher +# straight after install. +update-desktop-database /usr/share/applications 2>/dev/null || true diff --git a/apps/ui/src/electron/utils/icon-manager.ts b/apps/ui/src/electron/utils/icon-manager.ts index f6bdd529..7a0dda14 100644 --- a/apps/ui/src/electron/utils/icon-manager.ts +++ b/apps/ui/src/electron/utils/icon-manager.ts @@ -28,9 +28,11 @@ export function getIconPath(): string | null { } // __dirname is apps/ui/dist-electron (Vite bundles all into single file) + // In production the asar layout is: /dist-electron/main.js and /dist/logo_larger.png + // Vite copies public/ assets to the root of dist/, NOT dist/public/ const iconPath = isDev ? path.join(__dirname, '../public', iconFile) - : path.join(__dirname, '../dist/public', iconFile); + : path.join(__dirname, '../dist', iconFile); try { if (!electronAppExists(iconPath)) {