* Attempts to find the RCT2 installation directory. * This should be created from some other resource when OpenRCT2 grows. * @returns Path to RCT2, if found. Empty string otherwise. */
| 803 | * @returns Path to RCT2, if found. Empty string otherwise. |
| 804 | */ |
| 805 | static u8string FindRCT2Path() |
| 806 | { |
| 807 | LOG_VERBOSE("config_find_rct2_path(...)"); |
| 808 | |
| 809 | static std::vector<u8string> searchLocations = Platform::GetSearchablePathsRCT2(); |
| 810 | |
| 811 | for (const auto& location : searchLocations) |
| 812 | { |
| 813 | if (Platform::OriginalGameDataExists(location)) |
| 814 | { |
| 815 | return location; |
| 816 | } |
| 817 | } |
| 818 | |
| 819 | // Will only return a path if the RCT2 data is present, so no need to check twice. |
| 820 | auto steamPath = FindRCT2SteamPath(); |
| 821 | if (!steamPath.empty()) |
| 822 | { |
| 823 | return steamPath; |
| 824 | } |
| 825 | |
| 826 | auto discordPath = Platform::GetFolderPath(SpecialFolder::rct2Discord); |
| 827 | if (!discordPath.empty() && Platform::OriginalGameDataExists(discordPath)) |
| 828 | { |
| 829 | return discordPath; |
| 830 | } |
| 831 | |
| 832 | auto exePath = Path::GetDirectory(Platform::GetCurrentExecutablePath()); |
| 833 | if (Platform::OriginalGameDataExists(exePath)) |
| 834 | { |
| 835 | return exePath; |
| 836 | } |
| 837 | return {}; |
| 838 | } |
| 839 | |
| 840 | static u8string SelectGogInstaller() |
| 841 | { |
no test coverage detected