【问题标题】:How to find the path to Steam's sourcemods folder?如何找到 Steam 的 sourcemods 文件夹的路径?
【发布时间】:2015-03-13 15:48:45
【问题描述】:

如何找到 Steam 的 sourcemods 文件夹的路径? 例如C:\Program Files (x86)\Steam\SteamApps\sourcemods

此路径在 Windows 中存储在哪里?我需要以编程方式找到此路径来构建安装程序。

【问题讨论】:

    标签: steam


    【解决方案1】:

    您需要从HKEY_CURRENT_USER\Software\Valve\Steam 的注册表项中获取 SteamPath。然后添加文件夹/SteamApps/sourcemods/

    在 Qt 中是这样实现的:

    QSettings settings("HKEY_CURRENT_USER\\Software\\Valve\\Steam",
                       QSettings::NativeFormat);
    QString sourcemods_path = settings.value( "SteamPath", "" ).toString();
    if (!sourcemods_path.isEmpty())
    {
        sourcemods_path += "/SteamApps/sourcemods";
    }
    

    【讨论】:

      猜你喜欢
      • 2018-11-15
      • 2011-06-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-25
      • 1970-01-01
      • 2022-06-27
      • 2014-03-13
      相关资源
      最近更新 更多