From 56af34627705fc415dd3ab396dbb0263d3d5c165 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sat, 20 Jun 2020 01:01:48 +0200 Subject: [PATCH] Show Wine prefix overrides on the startup output This might otherwise cause confusion, since otherwise the printed Wine prefix might not actually be the prefix that will be used. --- CHANGELOG.md | 2 ++ src/plugin/plugin-bridge.cpp | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e713aa07..340738ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ Versioning](https://semver.org/spec/v2.0.0.html). Mixbus6. - Fixed plugin group socket name generation. This prevented plugin groups with the same name from being used simultaneously in multiple Wine prefixes. +- Fixed manual Wine prefix overides through the `WINEPREFIX` environment + variable not being reflected in the output shwon in startup. ## [1.2.0] - 2020-05-29 diff --git a/src/plugin/plugin-bridge.cpp b/src/plugin/plugin-bridge.cpp index 652bdf67..4f03bcb7 100644 --- a/src/plugin/plugin-bridge.cpp +++ b/src/plugin/plugin-bridge.cpp @@ -23,6 +23,7 @@ #include "../common/communication.h" #include "../common/events.h" +namespace bp = boost::process; // I'd rather use std::filesystem instead, but Boost.Process depends on // boost::filesystem namespace fs = boost::filesystem; @@ -592,9 +593,18 @@ void PluginBridge::log_init_message() { init_msg << "plugin: '" << vst_plugin_path.string() << "'" << std::endl; init_msg << "socket: '" << socket_endpoint.path() << "'" << std::endl; - init_msg << "wine prefix: '" - << find_wineprefix().value_or("").string() << "'" - << std::endl; + init_msg << "wine prefix: '"; + + // If the Wine prefix is manually overridden, then this should be made + // clear. This follows the behaviour of `set_wineprefix()`. + bp::native_environment env = boost::this_process::environment(); + if (!env["WINEPREFIX"].empty()) { + init_msg << env["WINEPREFIX"].to_string() << " "; + } else { + init_msg << find_wineprefix().value_or("").string(); + } + init_msg << "'" << std::endl; + init_msg << "wine version: '" << wine_version << "'" << std::endl; init_msg << std::endl;