godot-editor-plugin/addons/rider-plugin/cpp/src/rider_path_locator_windows.cpp [99:122]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
std::optional<InstallInfo> RiderPathLocator::get_install_info_from_rider_path(const std::string &path,
                                                                              InstallInfo::InstallType type) {
    if (!fs::exists(path)) return std::nullopt;

    // Expect ...\\bin\\rider64.exe
    std::regex re("(.*)(?:\\\\|/)bin");
    std::smatch m;
    if (!std::regex_search(path, m, re) || m.size() < 2) return std::nullopt;
    const fs::path rider_dir = m[1].str();

    const fs::path plugins = rider_dir / "plugins";
    if (!directory_exists_and_non_empty(plugins.string())) return std::nullopt;

    InstallInfo info;
    info.path = path;
    info.type = type;
    const fs::path product_info = rider_dir / "product-info.json";
    if (fs::exists(product_info)) parse_product_info_json(info, product_info.string());
    if (!info.version.initialized()) {
        info.version = rider_dir.filename().string();
        if (info.version.major() >= 221) info.support = InstallInfo::SupportUproject::Release;
    }
    return info;
}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



godot-editor-plugin/addons/rider-plugin/cpp/src/rider_path_locator_linux.cpp [21:45]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
std::optional<InstallInfo> RiderPathLocator::get_install_info_from_rider_path(const std::string &path,
                                                                              InstallInfo::InstallType type) {
    if (!fs::exists(path)) return std::nullopt;

    // Expect .../(bin)/rider.sh
    std::regex re("(.*)(?:\\\\|/)bin");
    std::smatch m;
    if (!std::regex_search(path, m, re) || m.size() < 2) return std::nullopt;
    const fs::path rider_dir = m[1].str();

    const fs::path plugins = rider_dir / "plugins";
    if (!directory_exists_and_non_empty(plugins.string())) return std::nullopt;

    InstallInfo info;
    info.path = path;
    info.type = type;
    const fs::path product_info = rider_dir / "product-info.json";
    if (fs::exists(product_info)) parse_product_info_json(info, product_info.string());
    if (!info.version.initialized()) {
        // Try to parse folder name as version
        info.version = rider_dir.filename().string();
        if (info.version.major() >= 221) info.support = InstallInfo::SupportUproject::Release;
    }
    return info;
}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



