From 1647ccb47324570c6530e10910442c946e7f02c2 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Wed, 9 Jul 2014 10:39:43 +0200 Subject: [PATCH] install an app id on Windows, to enable Windows 8 notifications without the need to install an extra fallback shortcut to the startmenu --- CMakeModules/NSIS.template.in | 6 ++++++ src/infoplugins/generic/snorenotify/SnoreNotifyPlugin.cpp | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeModules/NSIS.template.in b/CMakeModules/NSIS.template.in index 6880b8323..3d1f7ba7c 100644 --- a/CMakeModules/NSIS.template.in +++ b/CMakeModules/NSIS.template.in @@ -34,6 +34,9 @@ !define NSI_PATH "${SOURCE_PATH}/admin/win/nsi" +;define app id needed for Windows 8 notifications +!define AppUserModelId org.tomahawk-player.Tomahawk + ;----------------------------------------------------------------------------- ; Installer version ;----------------------------------------------------------------------------- @@ -400,6 +403,7 @@ SectionGroup "Shortcuts" CreateDirectory "$SMPROGRAMS\Tomahawk" CreateShortCut "$SMPROGRAMS\Tomahawk\LICENSE.lnk" "$INSTDIR\LICENSE.txt" CreateShortCut "$SMPROGRAMS\Tomahawk\Tomahawk.lnk" "$INSTDIR\tomahawk.exe" + WinShell::SetLnkAUMI "$SMPROGRAMS\Tomahawk\Tomahawk.lnk" "${AppUserModelId}" CreateShortCut "$SMPROGRAMS\Tomahawk\Release notes.lnk" "$INSTDIR\NOTES.txt" CreateShortCut "$SMPROGRAMS\Tomahawk\Uninstall.lnk" "$INSTDIR\uninstall.exe" SetShellVarContext current @@ -544,6 +548,8 @@ Section Uninstall ;Start menu shortcuts. !ifdef OPTION_SECTION_SC_START_MENU SetShellVarContext all + WinShell::UninstAppUserModelId "${AppUserModelId}" + WinShell::UninstShortcut "$SMPROGRAMS\Tomahawk\Tomahawk.lnk" RMDir /r "$SMPROGRAMS\Tomahawk" SetShellVarContext current !endif diff --git a/src/infoplugins/generic/snorenotify/SnoreNotifyPlugin.cpp b/src/infoplugins/generic/snorenotify/SnoreNotifyPlugin.cpp index f8dc361f2..488afb83a 100644 --- a/src/infoplugins/generic/snorenotify/SnoreNotifyPlugin.cpp +++ b/src/infoplugins/generic/snorenotify/SnoreNotifyPlugin.cpp @@ -81,7 +81,8 @@ SnoreNotifyPlugin::SnoreNotifyPlugin() tDebug( LOGVERBOSE ) << Q_FUNC_INFO << m_snore->primaryNotificationBackend(); m_application = Snore::Application( qApp->applicationName(), m_defaultIcon ); - m_application.hints().setValue( "desktop-entry" ,"tomahawk" ); + m_application.hints().setValue( "windows_app_id", "org.tomahawk-player.Tomahawk" ); + m_application.hints().setValue( "desktop-entry", "tomahawk" ); addAlert( InfoNotifyUser, tr( "Notify User" ) ); addAlert( InfoNowPlaying, tr( "Now Playing" ) );