From 171d8facee59a32f26c35cc813ec589fed3ecc67 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sat, 15 May 2021 23:03:23 +0200 Subject: [PATCH] [yabridgectl] Improve the Wine check warning This can also fail if you're using a version of yabridge that was compiled against more recent libraries. --- CHANGELOG.md | 2 ++ tools/yabridgectl/src/utils.rs | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9267d327..a58dcc05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,8 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### yabridgectl +- Improved the warning yabridgectl shows when it cannot run `yabridge-host.exe` + as part of the post-installation checks. - Fixed text wrapping being broken after a dependency update earlier this year. ## [3.2.0] - 2021-05-03 diff --git a/tools/yabridgectl/src/utils.rs b/tools/yabridgectl/src/utils.rs index 7e705d91..0cb75bcc 100644 --- a/tools/yabridgectl/src/utils.rs +++ b/tools/yabridgectl/src/utils.rs @@ -316,18 +316,23 @@ pub fn verify_wine_setup(config: &mut Config) -> Result<()> { eprintln!( "\n{}", wrap(&format!( - "Warning: Could not run 'yabridge-host.exe'. Wine reported the following error: \n\ + "Warning: Could not run '{yabridge_host}'. Wine reported the following error:\n\ \n\ - {}\n\ + {error}\n\ \n\ - This can happen when using a version of Wine that is much older than the version \ - that has been used to compile yabridge with. Your current Wine version is '{}'. \ - See the troubleshooting section of the readme for more information on how to \ - upgrade your installation of Wine.\n\ + Make sure that you have downloaded the correct version of yabridge for your distro.\n\ + This can also happen when using a version of Wine that's not compatible with this \ + version of yabridge, in which case you'll need to upgrade Wine. Your current Wine \ + version is '{wine_version}'. \ + See the link below for instructions on how to upgrade your installation of Wine.\n\ + Finally, if the default Wine prefix over at {wine_prefix} is set to 32-bit only, \ + this check will also fail as the 64-bit {yabridge_host} won't be able to run. \n\ https://github.com/robbert-vdh/yabridge#troubleshooting-common-issues", - last_error.unwrap_or("").bright_white(), - wine_version + yabridge_host = "yabridge-host.exe".bright_white(), + wine_prefix = "~/.wine".bright_white(), + error = last_error.unwrap_or("").bright_white(), + wine_version = wine_version .strip_prefix("wine-") .unwrap_or(&wine_version) .bright_white(),