Play your Steam library's Windows games on a jailbroken PS5.
C++
Stop labelling installers beside Unreal games as Unreal - A redistributable installer next to an Unreal game's Engine folder (Subnautica 2's `VC_redist.x64.exe`) showed in the Program picker as "Unreal Engine 5 · Direct3D 12", as if it were the game. Programs named like an installer (redist, dxsetup, uninst, prereq) are no longer taken for Unreal's root launcher, so they keep their own label and are not swapped for the Shipping program.
Leonardo Lobato4ea0d9224e5a
diff --git a/src/runtime/game_probe.cpp b/src/runtime/game_probe.cppindex 12683fa..81f1c3e 100644--- a/src/runtime/game_probe.cpp+++ b/src/runtime/game_probe.cpp@@ -201,6 +201,9 @@ void AddImports(const PeFacts& facts, std::set<std::string>* apis) {constexpr std::pair<const char*, const char*> kEngineMarks[] = {{"sil_windows_use_", "sil"},{"microsoft.xna.framework", "xna"}};+// An installer the game ships beside Unreal's Engine folder (VC_redist.x64.exe) is not the game.+constexpr const char* kInstallerWords[] = {"redist", "dxsetup", "uninst", "prereq"};+// Unreal Engine 5 names Nanite's console variables (as UTF-16, scanned in lower case); Unreal 4 has no Nanite.constexpr char kUnreal5Mark[] = "r\0.\0n\0a\0n\0i\0t\0e\0";@@ -360,7 +363,11 @@ GameProbe ProbeGame(const std::string& install_root, const std::string& executabprobe.il2cpp = Find(here, "gameassembly.dll", false).has_value();probe.legacy_unity = !unity;if (unity) ScanNames((root / folder / *unity).string(), &probe.apis);- } else if (EndsWith(lower_file, "-shipping.exe") || Find(here, "engine", true)) {+ } else if (EndsWith(lower_file, "-shipping.exe") ||+ (Find(here, "engine", true) && std::none_of(std::begin(kInstallerWords), std::end(kInstallerWords),+ [&](const char* word) {+ return lower_file.find(word) != std::string::npos;+ }))) {probe.engine = "unreal";if (!EndsWith(lower_file, "-shipping.exe")) {probe.unreal_program = FindShipping(root, folder, 0);diff --git a/tests/game_probe_test.cpp b/tests/game_probe_test.cppindex f1a65e3..91b8885 100644--- a/tests/game_probe_test.cpp+++ b/tests/game_probe_test.cpp@@ -358,6 +358,10 @@ int main() {CHECK(older.d3d12.empty() && older.arguments == "-dx11");CHECK(DetectedLabel(older.summary) == "Unreal Engine 5 \xC2\xB7 Direct3D 11");// Started as the Shipping program itself (which imports d3d12), the same, label included.+ // A redistributable installer beside the Engine folder is not the game (the Program picker labelled it Unreal 5).+ WritePe(root / "VC_redist.x64.exe", {false, {"KERNEL32.dll"}});+ const auto redist = ProbeGame(root.string(), "VC_redist.x64.exe");+ CHECK(redist.engine.empty() && !redist.unreal5 && redist.unreal_program.empty());const auto direct = ProbeGame(root.string(), "Hellraiser/Binaries/Win64/Hellraiser-Win64-Shipping.exe");CHECK(direct.unreal5 && DefaultsFor(direct, vkd3d).d3d12 == "vkd3d-proton");CHECK(DetectedLabel(DefaultsFor(direct).summary) == "Unreal Engine 5 \xC2\xB7 Direct3D 11");