@@ -1993,6 +1993,25 @@ function logWindowsIconProbeAlways(windowIcon) {
19931993 }
19941994}
19951995
1996+ /**
1997+ * Path for setAppDetails (taskbar / Jump List): prefer the .exe when Chromium can decode an embedded
1998+ * icon — Windows shell uses the exe for the taskbar more reliably than a loose .ico in that case.
1999+ * Otherwise use resources\\icon.ico (see embed-windows-exe-icon.cjs + afterSign).
2000+ */
2001+ function resolveWindowsTaskbarDetailsIconPath ( ) {
2002+ if ( process . platform !== "win32" || ! app . isPackaged ) return null ;
2003+ const exe = process . execPath ;
2004+ const ico = ensureWindowsIcoFileOnDiskSync ( ) ;
2005+ try {
2006+ if ( fs . existsSync ( exe ) ) {
2007+ const niFromExe = nativeImage . createFromPath ( exe ) ;
2008+ if ( ! niFromExe . isEmpty ( ) ) return exe ;
2009+ }
2010+ } catch ( _ ) { }
2011+ if ( ico && fs . existsSync ( ico ) ) return ico ;
2012+ return fs . existsSync ( exe ) ? exe : ico ;
2013+ }
2014+
19962015/** Logs once per main window: summary + probe(always); full dump when HSP_DEBUG_ICON=1. */
19972016function logWindowsIconEnvironment ( windowIcon ) {
19982017 if ( process . platform !== "win32" || ! app . isPackaged ) return ;
@@ -2117,7 +2136,7 @@ async function createWindow() {
21172136 // Win32: ties this HWND to AppUserModelID + icon for the taskbar button (see Electron BrowserWindow.setAppDetails).
21182137 if ( process . platform === "win32" && fs . existsSync ( process . execPath ) ) {
21192138 try {
2120- const detailsIcon = ensureWindowsIcoFileOnDiskSync ( ) || process . execPath ;
2139+ const detailsIcon = resolveWindowsTaskbarDetailsIconPath ( ) ;
21212140 if ( detailsIcon && fs . existsSync ( detailsIcon ) ) {
21222141 mainWindow . setAppDetails ( {
21232142 appId : WIN_APP_USER_MODEL_ID ,
0 commit comments