From 6e72536e3728e60f740f4c8c6398f7300b446cbc Mon Sep 17 00:00:00 2001 From: deepend-tildeclub Date: Wed, 10 Jun 2026 09:25:37 -0600 Subject: [PATCH] Apply AppUserModelID to all shortcuts, fix toast init order --- src/fe-gtk/notifications/notification-winrt.cpp | 14 ++++++++------ win32/installer/zoitechat.iss.tt | 10 +++++----- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/fe-gtk/notifications/notification-winrt.cpp b/src/fe-gtk/notifications/notification-winrt.cpp index 1b1dcd06..5d1a530d 100644 --- a/src/fe-gtk/notifications/notification-winrt.cpp +++ b/src/fe-gtk/notifications/notification-winrt.cpp @@ -85,6 +85,12 @@ extern "C" __declspec (dllexport) int notification_backend_init (const char **error) { + if (FAILED (Windows::Foundation::Initialize (RO_INIT_SINGLETHREADED))) + { + *error = "Error initializing Windows::Foundation."; + return 0; + } + try { if (!notifier) @@ -92,6 +98,7 @@ extern "C" } catch (Platform::Exception ^ ex) { + Windows::Foundation::Uninitialize (); static char exc_message[1024]; std::string tmp = narrow(std::wstring(ex->Message->Data())); if (SUCCEEDED(StringCchPrintfA(exc_message, _countof(exc_message), "Error (0x%x): %s", ex->HResult, tmp.c_str()))) @@ -102,16 +109,11 @@ extern "C" } catch (...) { + Windows::Foundation::Uninitialize (); *error = "Generic c++ exception."; return 0; } - if (FAILED (Windows::Foundation::Initialize (RO_INIT_SINGLETHREADED))) - { - *error = "Error initializing Windows::Foundation."; - return 0; - } - return 1; } diff --git a/win32/installer/zoitechat.iss.tt b/win32/installer/zoitechat.iss.tt index 654a5899..fbfb5723 100644 --- a/win32/installer/zoitechat.iss.tt +++ b/win32/installer/zoitechat.iss.tt @@ -194,11 +194,11 @@ Source: "zoitechat-text.exe"; DestDir: "{app}"; Flags: ignoreversion; Components [Icons] Name: "{group}\ZoiteChat"; Filename: "{app}\zoitechat.exe"; AppUserModelID: "{#ZOITECHAT_APPUSERMODELID}"; Tasks: not portable; Check: not WizardNoIcons Name: "{group}\ZoiteChat Safe Mode"; Filename: "{app}\zoitechat.exe"; Parameters: "--no-auto --no-plugins"; AppUserModelID: "{#ZOITECHAT_APPUSERMODELID}"; Tasks: not portable; Check: not WizardNoIcons -Name: "{group}\ZoiteChat ChangeLog"; Filename: "{app}\changelog.url"; IconFilename: "{sys}\shell32.dll"; IconIndex: 165; Tasks: not portable; Check: not WizardNoIcons -Name: "{group}\ZoiteChat ReadMe"; Filename: "{app}\readme.url"; IconFilename: "{sys}\shell32.dll"; IconIndex: 23; Tasks: not portable; Check: not WizardNoIcons -Name: "{group}\ZoiteChat Config Folder"; Filename: "%APPDATA%\ZoiteChat\"; Tasks: not portable; Check: not WizardNoIcons -Name: "{group}\ZoiteChat-Text"; Filename: "{app}\zoitechat-text.exe"; Components: xctext; Tasks: not portable; Check: not WizardNoIcons -Name: "{group}\Uninstall ZoiteChat"; Filename: "{uninstallexe}"; Tasks: not portable; Check: not WizardNoIcons +Name: "{group}\ZoiteChat ChangeLog"; Filename: "{app}\changelog.url"; IconFilename: "{sys}\shell32.dll"; IconIndex: 165; AppUserModelID: "{#ZOITECHAT_APPUSERMODELID}"; Tasks: not portable; Check: not WizardNoIcons +Name: "{group}\ZoiteChat ReadMe"; Filename: "{app}\readme.url"; IconFilename: "{sys}\shell32.dll"; IconIndex: 23; AppUserModelID: "{#ZOITECHAT_APPUSERMODELID}"; Tasks: not portable; Check: not WizardNoIcons +Name: "{group}\ZoiteChat Config Folder"; Filename: "%APPDATA%\ZoiteChat\"; AppUserModelID: "{#ZOITECHAT_APPUSERMODELID}"; Tasks: not portable; Check: not WizardNoIcons +Name: "{group}\ZoiteChat-Text"; Filename: "{app}\zoitechat-text.exe"; AppUserModelID: "{#ZOITECHAT_APPUSERMODELID}"; Components: xctext; Tasks: not portable; Check: not WizardNoIcons +Name: "{group}\Uninstall ZoiteChat"; Filename: "{uninstallexe}"; AppUserModelID: "{#ZOITECHAT_APPUSERMODELID}"; Tasks: not portable; Check: not WizardNoIcons Name: "{commondesktop}\ZoiteChat"; Filename: "{app}\zoitechat.exe"; AppUserModelID: "{#ZOITECHAT_APPUSERMODELID}"; Components: icons\desktopicon; Tasks: not portable Name: "{commonappdata}\Microsoft\Internet Explorer\Quick Launch\ZoiteChat"; Filename: "{app}\zoitechat.exe"; AppUserModelID: "{#ZOITECHAT_APPUSERMODELID}"; Components: icons\quicklaunchicon; Tasks: not portable