Skip to content

[GEN][ZH] Add Windows application manifest to executables #595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Generals/Code/Main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ target_sources(g_generals PRIVATE
)

if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows")
# VS2005 and later adds default manifest, we need to turn it off to prevent conflict with custom manifest
if(NOT IS_VS6_BUILD)
target_link_options(g_generals PRIVATE
"/MANIFEST:NO"
)
endif()

target_sources(g_generals PRIVATE
RTS.RC
)
Expand Down
2 changes: 2 additions & 0 deletions Generals/Code/Main/RTS.RC
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ IDB_LOAD_SCREEN BITMAP DISCARDABLE "Install_Final.bmp"
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////

// Add manifest to specify that the app is DPI aware and prevent forced scaling by the system
1 24 "app.manifest"


#ifndef APSTUDIO_INVOKED
Expand Down
28 changes: 28 additions & 0 deletions Generals/Code/Main/app.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The manifest file should probably be templated for cmake to generate so we aren't hard coding 32bit unless "win32" covers both 32bit and 64bit applications?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's also win32 for 64-bit. Win32 is the name of the Windows-API, even the 64-bit version.

name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<asmv3:application>
<asmv3:windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
7 changes: 7 additions & 0 deletions GeneralsMD/Code/Main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ target_sources(z_generals PRIVATE
)

if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows")
# VS2005 and later adds default manifest, we need to turn it off to prevent conflict with custom manifest
if(NOT IS_VS6_BUILD)
target_link_options(z_generals PRIVATE
"/MANIFEST:NO"
)
endif()

target_sources(z_generals PRIVATE
RTS.RC
)
Expand Down
2 changes: 2 additions & 0 deletions GeneralsMD/Code/Main/RTS.RC
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ IDI_ApplicationIcon ICON DISCARDABLE "GENERALS.ICO"
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////

// Add manifest to specify that the app is DPI aware and prevent forced scaling by the system
1 24 "app.manifest"


#ifndef APSTUDIO_INVOKED
Expand Down
28 changes: 28 additions & 0 deletions GeneralsMD/Code/Main/app.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<asmv3:application>
<asmv3:windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>