Skip to content

Commit fb0f505

Browse files
committed
[libromdata/tests] GcnFstPrint, WiiUFstPrint: Add manifests for Windows 10.
Otherwise, libgsvt will call IsWindows10OrGreater() and get FALSE, so it won't attempt to enable UTF-8 console output. gsvt_init_win32() will detect the enhanced VT functionality, so it will enable it with the expectation that UTF-8 console output is enabled. Since it isn't enabled, we end up getting mojibake. This fixes UTF-8 output for GcnFstPrint and WiiUFstPrint on Windows 10. (Not 100% certain when it broke, but it probably broke at some point while I was implementing libgsvt, which would be v2.6.)
1 parent 13ef8b8 commit fb0f505

File tree

5 files changed

+232
-0
lines changed

5 files changed

+232
-0
lines changed

src/libromdata/tests/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,20 @@ IF(ENABLE_DECRYPTION)
3333
ENDIF(ENABLE_DECRYPTION)
3434

3535
# GcnFstPrint (Not a test, but a useful program.)
36+
IF(WIN32)
37+
SET(GcnFstPrint_RC disc/GcnFstPrint.rc)
38+
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/disc/GcnFstPrint.exe.manifest.in" "${CMAKE_CURRENT_BINARY_DIR}/disc/GcnFstPrint.exe.manifest" @ONLY)
39+
ENDIF(WIN32)
3640
ADD_EXECUTABLE(GcnFstPrint
3741
disc/FstPrint.cpp
3842
disc/GcnFstPrint.cpp
3943

4044
disc/FstPrint.hpp
45+
46+
${GcnFstPrint_RC}
4147
)
48+
# Include path: Add the top-level binary directory for git_version.h.
49+
TARGET_INCLUDE_DIRECTORIES(GcnFstPrint PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>)
4250
TARGET_LINK_LIBRARIES(GcnFstPrint PRIVATE rpsecure romdata)
4351
TARGET_LINK_LIBRARIES(GcnFstPrint PRIVATE gsvt)
4452
IF(ENABLE_NLS)
@@ -81,12 +89,20 @@ IF(NOT WIN32 AND NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY STREQUAL "")
8189
ENDIF(NOT WIN32 AND NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY STREQUAL "")
8290

8391
# WiiUFstPrint (Not a test, but a useful program.)
92+
IF(WIN32)
93+
SET(WiiUFstPrint_RC disc/WiiUFstPrint.rc)
94+
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/disc/WiiUFstPrint.exe.manifest.in" "${CMAKE_CURRENT_BINARY_DIR}/disc/WiiUFstPrint.exe.manifest" @ONLY)
95+
ENDIF(WIN32)
8496
ADD_EXECUTABLE(WiiUFstPrint
8597
disc/FstPrint.cpp
8698
disc/WiiUFstPrint.cpp
8799

88100
disc/FstPrint.hpp
101+
102+
${WiiUFstPrint_RC}
89103
)
104+
# Include path: Add the top-level binary directory for git_version.h.
105+
TARGET_INCLUDE_DIRECTORIES(WiiUFstPrint PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>)
90106
TARGET_LINK_LIBRARIES(WiiUFstPrint PRIVATE rpsecure romdata)
91107
TARGET_LINK_LIBRARIES(WiiUFstPrint PRIVATE gsvt)
92108
IF(ENABLE_NLS)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
3+
<assemblyIdentity
4+
type="win32"
5+
name="GerbilSoft.RomPropeties.tests.GcnFstPrint"
6+
version="@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@.@CMAKE_PROJECT_VERSION_PATCH@.@CMAKE_PROJECT_VERSION_TWEAK@"
7+
processorArchitecture="@WIN32_MANIFEST_PROCESSOR_ARCHITECTURE@"
8+
/>
9+
10+
<description>ROM Properties Page command line interface</description>
11+
12+
<!-- Application security requirements. Used for Vista UAC. -->
13+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
14+
<security>
15+
<requestedPrivileges>
16+
<requestedExecutionLevel
17+
level="asInvoker"
18+
uiAccess="false"
19+
/>
20+
</requestedPrivileges>
21+
</security>
22+
</trustInfo>
23+
24+
<!-- Operating system compatibility -->
25+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
26+
<application>
27+
<!-- Windows 10 and Windows 11 -->
28+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
29+
<!-- Windows 8.1 -->
30+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
31+
<!-- Windows 8 -->
32+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
33+
<!-- Windows 7 -->
34+
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
35+
<!-- Windows Vista -->
36+
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
37+
</application>
38+
</compatibility>
39+
40+
<asmv3:application>
41+
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
42+
<!-- Mark this program as DPI-aware on Windows Vista and later. -->
43+
<!-- TODO: Windows 8 per-monitor DPI awareness. -->
44+
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
45+
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">system</dpiAwareness>
46+
47+
<!-- Enable long paths (>260 chars) on Windows 10 Anniversary Update. (1607) -->
48+
<ws2:longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</ws2:longPathAware>
49+
</asmv3:windowsSettings>
50+
</asmv3:application>
51+
</assembly>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/***************************************************************************
2+
* ROM Properties Page shell extension. (libromdata/tests) *
3+
* GcnFstPrint.rc: Win32 resource script for GcnFstPrint. *
4+
* *
5+
* Copyright (c) 2016-2026 by David Korth. *
6+
* SPDX-License-Identifier: GPL-2.0-or-later *
7+
***************************************************************************/
8+
9+
// UTF-8 encoding
10+
#pragma code_page(65001)
11+
12+
// Common rom-properties resource header
13+
#include "resource.common.inc.h"
14+
15+
/** Manifest **/
16+
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
17+
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "disc\\GcnFstPrint.exe.manifest"
18+
19+
// TODO: The git version gets cut off on Windows 7, since it uses
20+
// a ListView instead of separate ListBox and Edit controls like
21+
// on Windows XP.
22+
23+
/** Application version **/
24+
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
25+
VS_VERSION_INFO VERSIONINFO
26+
FILEVERSION RP_VERSION_WIN32
27+
PRODUCTVERSION RP_VERSION_WIN32
28+
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
29+
FILEFLAGS RP_VS_FILEFLAGS
30+
FILEOS VOS_NT_WINDOWS32
31+
FILETYPE VFT_APP
32+
FILESUBTYPE 0x0L
33+
BEGIN
34+
BLOCK "StringFileInfo"
35+
BEGIN
36+
/* English (US), Unicode */
37+
BLOCK "040904B0"
38+
BEGIN
39+
//VALUE "Comments"
40+
//VALUE "CompanyName"
41+
VALUE "FileDescription", "rom-properties - GcnFstPrint test program"
42+
VALUE "FileVersion", "GcnFstPrint " Win32_RC_FileVersion
43+
VALUE "InternalName", "GcnFstPrint"
44+
VALUE "LegalCopyright", "Copyright (c) 2016-2026 by David Korth."
45+
//VALUE "LegalTrademarks"
46+
//VALUE "OriginalFilename"
47+
//VALUE "PrivateBuild"
48+
VALUE "ProductName", "rom-properties - GcnFstPrint test program"
49+
VALUE "ProductVersion", "GcnFstPrint " Win32_RC_FileVersion
50+
//VALUE "SpecialBuild"
51+
END
52+
END
53+
BLOCK "VarFileInfo"
54+
BEGIN
55+
VALUE "Translation", 0x409, 1200
56+
END
57+
END
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
3+
<assemblyIdentity
4+
type="win32"
5+
name="GerbilSoft.RomPropeties.tests.WiiUFstPrint"
6+
version="@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@.@CMAKE_PROJECT_VERSION_PATCH@.@CMAKE_PROJECT_VERSION_TWEAK@"
7+
processorArchitecture="@WIN32_MANIFEST_PROCESSOR_ARCHITECTURE@"
8+
/>
9+
10+
<description>ROM Properties Page command line interface</description>
11+
12+
<!-- Application security requirements. Used for Vista UAC. -->
13+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
14+
<security>
15+
<requestedPrivileges>
16+
<requestedExecutionLevel
17+
level="asInvoker"
18+
uiAccess="false"
19+
/>
20+
</requestedPrivileges>
21+
</security>
22+
</trustInfo>
23+
24+
<!-- Operating system compatibility -->
25+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
26+
<application>
27+
<!-- Windows 10 and Windows 11 -->
28+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
29+
<!-- Windows 8.1 -->
30+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
31+
<!-- Windows 8 -->
32+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
33+
<!-- Windows 7 -->
34+
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
35+
<!-- Windows Vista -->
36+
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
37+
</application>
38+
</compatibility>
39+
40+
<asmv3:application>
41+
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
42+
<!-- Mark this program as DPI-aware on Windows Vista and later. -->
43+
<!-- TODO: Windows 8 per-monitor DPI awareness. -->
44+
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
45+
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">system</dpiAwareness>
46+
47+
<!-- Enable long paths (>260 chars) on Windows 10 Anniversary Update. (1607) -->
48+
<ws2:longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</ws2:longPathAware>
49+
</asmv3:windowsSettings>
50+
</asmv3:application>
51+
</assembly>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/***************************************************************************
2+
* ROM Properties Page shell extension. (libromdata/tests) *
3+
* WiiUFstPrint.rc: Win32 resource script for WiiUFstPrint. *
4+
* *
5+
* Copyright (c) 2016-2026 by David Korth. *
6+
* SPDX-License-Identifier: GPL-2.0-or-later *
7+
***************************************************************************/
8+
9+
// UTF-8 encoding
10+
#pragma code_page(65001)
11+
12+
// Common rom-properties resource header
13+
#include "resource.common.inc.h"
14+
15+
/** Manifest **/
16+
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
17+
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "disc\\WiiUFstPrint.exe.manifest"
18+
19+
// TODO: The git version gets cut off on Windows 7, since it uses
20+
// a ListView instead of separate ListBox and Edit controls like
21+
// on Windows XP.
22+
23+
/** Application version **/
24+
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
25+
VS_VERSION_INFO VERSIONINFO
26+
FILEVERSION RP_VERSION_WIN32
27+
PRODUCTVERSION RP_VERSION_WIN32
28+
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
29+
FILEFLAGS RP_VS_FILEFLAGS
30+
FILEOS VOS_NT_WINDOWS32
31+
FILETYPE VFT_APP
32+
FILESUBTYPE 0x0L
33+
BEGIN
34+
BLOCK "StringFileInfo"
35+
BEGIN
36+
/* English (US), Unicode */
37+
BLOCK "040904B0"
38+
BEGIN
39+
//VALUE "Comments"
40+
//VALUE "CompanyName"
41+
VALUE "FileDescription", "rom-properties - WiiUFstPrint test program"
42+
VALUE "FileVersion", "WiiUFstPrint " Win32_RC_FileVersion
43+
VALUE "InternalName", "WiiUFstPrint"
44+
VALUE "LegalCopyright", "Copyright (c) 2016-2026 by David Korth."
45+
//VALUE "LegalTrademarks"
46+
//VALUE "OriginalFilename"
47+
//VALUE "PrivateBuild"
48+
VALUE "ProductName", "rom-properties - WiiUFstPrint test program"
49+
VALUE "ProductVersion", "WiiUFstPrint " Win32_RC_FileVersion
50+
//VALUE "SpecialBuild"
51+
END
52+
END
53+
BLOCK "VarFileInfo"
54+
BEGIN
55+
VALUE "Translation", 0x409, 1200
56+
END
57+
END

0 commit comments

Comments
 (0)