diff --git a/CHANGELOG.md b/CHANGELOG.md index 26da6955..8bbc5c84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed + +- Fixed an initialization error when using plugin groups for plugins that are + installed outside of a Wine prefix. + ### yabridgectl - Resolve relative paths when adding plugin directories or when changing diff --git a/src/plugin/host-process.cpp b/src/plugin/host-process.cpp index 9c6b9871..e8c3745c 100644 --- a/src/plugin/host-process.cpp +++ b/src/plugin/host-process.cpp @@ -149,8 +149,14 @@ GroupHost::GroupHost( // the first process will handle the connections for both yabridge // instances. const bp::environment host_env = set_wineprefix(); - fs::path wine_prefix = host_env.at("WINEPREFIX").to_string(); - if (host_env.at("WINEPREFIX").empty()) { + fs::path wine_prefix; + if (auto wine_prefix_envvar = host_env.find("WINEPREFIX"); + wine_prefix_envvar != host_env.end()) { + // This is a bit ugly, but Boost.Process's environment does not have a + // graceful way to check for empty environment variables in const + // qualified environments + wine_prefix = wine_prefix_envvar->to_string(); + } else { // Fall back to `~/.wine` if this has not been set or detected. This // would happen if the plugin's .dll file is not inside of a Wine // prefix. If this happens, then the Wine instance will be launched in