Skip to content

Commit 47c2b89

Browse files
committed
Add manifest for MTA launcher executable
1 parent 0f2bfc8 commit 47c2b89

File tree

3 files changed

+35
-42
lines changed

3 files changed

+35
-42
lines changed

Client/launch/Main.cpp

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*****************************************************************************/
1111

1212
#include "StdInc.h"
13-
#include <ShellScalingApi.h>
1413

1514
/*
1615
IMPORTANT
@@ -23,44 +22,6 @@
2322
(set flag.new_client_exe on the build server to generate new exe)
2423
*/
2524

26-
/**
27-
* @brief Applies the highest available form of DPI awareness for this process.
28-
*/
29-
void ApplyDpiAwareness()
30-
{
31-
// Minimum version: Windows 10, version 1607
32-
using SetProcessDpiAwarenessContext_t = BOOL(WINAPI*)(DPI_AWARENESS_CONTEXT value);
33-
34-
static SetProcessDpiAwarenessContext_t Win32SetProcessDpiAwarenessContext = ([] {
35-
HMODULE user32 = LoadLibrary("user32");
36-
return user32 ? reinterpret_cast<SetProcessDpiAwarenessContext_t>(static_cast<void*>(GetProcAddress(user32, "SetProcessDpiAwarenessContext")))
37-
: nullptr;
38-
})();
39-
40-
if (Win32SetProcessDpiAwarenessContext)
41-
{
42-
Win32SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
43-
return;
44-
}
45-
46-
// Minimum version: Windows 8.1
47-
using SetProcessDpiAwareness_t = HRESULT(WINAPI*)(PROCESS_DPI_AWARENESS value);
48-
49-
static SetProcessDpiAwareness_t Win32SetProcessDpiAwareness = ([] {
50-
HMODULE shcore = LoadLibrary("shcore");
51-
return shcore ? reinterpret_cast<SetProcessDpiAwareness_t>(static_cast<void*>(GetProcAddress(shcore, "SetProcessDpiAwareness"))) : nullptr;
52-
})();
53-
54-
if (Win32SetProcessDpiAwareness)
55-
{
56-
Win32SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
57-
return;
58-
}
59-
60-
// Minimum version: Windows Vista
61-
SetProcessDPIAware();
62-
}
63-
6425
///////////////////////////////////////////////////////////////
6526
//
6627
// WinMain
@@ -76,8 +37,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
7637
return 1;
7738
}
7839

79-
ApplyDpiAwareness();
80-
8140
// Group our processes and windows under a single taskbar button
8241
SetCurrentProcessExplicitAppUserModelID(L"Multi Theft Auto");
8342

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:v3="urn:schemas-microsoft-com:asm.v3">
3+
<assemblyIdentity type="win32" version="1.6.0.0" processorArchitecture="*" name="Multi Theft Auto" />
4+
5+
<v3:application>
6+
<windowsSettings>
7+
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
8+
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
9+
</windowsSettings>
10+
</v3:application>
11+
12+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
13+
<application>
14+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" /> <!-- Windows 10 and Windows 11 -->
15+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" /> <!-- Windows 8.1 -->
16+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" /> <!-- Windows 8 -->
17+
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" /> <!-- Windows 7 -->
18+
</application>
19+
</compatibility>
20+
21+
<dependency optional="yes">
22+
<dependentAssembly>
23+
<!-- Automatically use ComCtl32.dll version 6 or later. -->
24+
<assemblyIdentity
25+
type="win32"
26+
name="Microsoft.Windows.Common-Controls"
27+
version="6.0.0.0"
28+
processorArchitecture="*"
29+
publicKeyToken="6595b64144ccf1df"
30+
language="*" />
31+
</dependentAssembly>
32+
</dependency>
33+
</assembly>

Client/launch/premake5.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ project "Client Launcher"
1818
vpaths {
1919
["Headers/*"] = "**.h",
2020
["Sources/*"] = "**.cpp",
21-
["Resources/*"] = {"*.rc", "**.ico", "**.xml"},
21+
["Resources/*"] = {"*.rc", "**.ico", "**.xml", "**.manifest"},
2222
["*"] = "premake5.lua"
2323
}
2424

@@ -35,6 +35,7 @@ project "Client Launcher"
3535
"NEU/Multi Theft Auto.gdf.xml",
3636
"launch.rc",
3737
"Multi Theft Auto.rc",
38+
"Multi Theft Auto.manifest",
3839
"resource/mtaicon.ico"
3940
}
4041

0 commit comments

Comments
 (0)