Skip to content

Commit 2df92c6

Browse files
committed
Set Application ID on client shortcut
We can use this to display better looking app notifications https://learn.microsoft.com/en-us/windows/win32/shell/appids
1 parent ac7351f commit 2df92c6

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

Client/core/Core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ CORE_API int InitializeCore()
9191
return 4;
9292

9393
// Group our processes and windows under a single taskbar button
94-
SetCurrentProcessExplicitAppUserModelID(L"Multi Theft Auto");
94+
SetCurrentProcessExplicitAppUserModelID(L"Multi Theft Auto " MTA_STR(MTASA_VERSION_MAJOR) L"." MTA_STR(MTASA_VERSION_MINOR));
9595

9696
WriteDebugEvent(SString("ModuleFileName: %s", *GetLaunchPathFilename()));
9797

Client/launch/Main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ int WINAPI WinMain(HINSTANCE hInstance, [[maybe_unused]] HINSTANCE hPrevInstance
863863
}
864864

865865
// Group processes under single taskbar button
866-
static_cast<void>(::SetCurrentProcessExplicitAppUserModelID(L"Multi Theft Auto"));
866+
SetCurrentProcessExplicitAppUserModelID(L"Multi Theft Auto " MTA_STR(MTASA_VERSION_MAJOR) L"." MTA_STR(MTASA_VERSION_MINOR));
867867

868868
// Load the loader.dll
869869
SString strLoaderDllFilename;
Binary file not shown.

Shared/installer/nightly.nsi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Var UninstallExePath
5353
; Games explorer: With each new X.X, update this GUID and the file at MTA10\launch\NEU\Multi Theft Auto.gdf.xml
5454
!define GUID "{8A7FC5C7-0023-4CD7-B1D6-89073CFD838F}"
5555

56-
5756
!ifndef MAJOR_VER
5857
!define MAJOR_VER "1"
5958
!define MINOR_VER "7"
@@ -62,6 +61,8 @@ Var UninstallExePath
6261
!define 0.0 "${MAJOR_VER}.${MINOR_VER}"
6362
!define 0.0.0 "${MAJOR_VER}.${MINOR_VER}.${MAINT_VER}"
6463

64+
!define APPLICATION_ID "Multi Theft Auto ${0.0}"
65+
6566
; ###########################################################################################################
6667
!ifndef FILES_ROOT
6768
!define LIGHTBUILD ; enable LIGHTBUILD for nightly
@@ -391,6 +392,12 @@ Function .onInstSuccess
391392
Push $StartMenuClientShortcutPath
392393
Call MTACreateShortсut
393394
${EndIf}
395+
${If} ${FileExists} $StartMenuClientShortcutPath
396+
ApplicationID::Set "$StartMenuClientShortcutPath" "${APPLICATION_ID}"
397+
${If} ${Errors}
398+
${LogText} "Error setting Application ID for client shortcut"
399+
${EndIf}
400+
${EndIf}
394401
# Either update or create Server shortcut
395402
${If} ${FileExists} $StartMenuServerShortcutPath
396403
Push $ServerExePath

0 commit comments

Comments
 (0)