diff options
| author | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-03-29 01:21:51 -0500 |
|---|---|---|
| committer | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-03-29 01:21:51 -0500 |
| commit | 92a901c07406582b1d823ee1150c749cd9e4212d (patch) | |
| tree | e6eafd6a6ff04baec264257b6a17e58aa440f787 | |
| parent | 747f32a1fa2ac2a7af6293d2ed83ee3dbe7986ca (diff) | |
Block game launch when no Wine prefix is configured
Instead of logging a warning and attempting to launch (which fails with
EACCES), show a clear error dialog directing the user to Settings →
Wine/Proton to create a prefix.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| -rw-r--r-- | src/src/spawn.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/src/spawn.cpp b/src/src/spawn.cpp index 4a4d32b..d94fbae 100644 --- a/src/src/spawn.cpp +++ b/src/src/spawn.cpp @@ -663,13 +663,15 @@ int spawn(const SpawnParameters &sp, pid_t &processId) { const QString prefixPath = resolvePrefixPath();
if (prefixPath.isEmpty()) {
- MOBase::log::warn(
- "No Wine prefix configured - games may not launch correctly. "
- "Configure a prefix in Settings > Proton or via fluorine-manager.");
+ MOBase::log::error(
+ "No Wine prefix configured - cannot launch game. "
+ "Configure a prefix in Settings > Proton.");
+ return ENOENT;
} else if (!QDir(QDir(prefixPath).filePath("drive_c")).exists()) {
- MOBase::log::warn(
- "Wine prefix '{}' does not contain drive_c/ - prefix may be invalid",
+ MOBase::log::error(
+ "Wine prefix '{}' does not contain drive_c/ - prefix is invalid",
prefixPath);
+ return ENOENT;
} else {
MOBase::log::info("Using Wine prefix: {}", prefixPath);
launcher.setPrefix(prefixPath);
@@ -1024,7 +1026,19 @@ pid_t startBinary(QWidget *parent, const SpawnParameters &sp) { const auto e = spawn::spawn(sp, pid);
if (e != 0) {
- dialogs::spawnFailed(parent, sp, e);
+ if (e == ENOENT && sp.useProton) {
+ QMessageBox::critical(
+ parent, QObject::tr("No Wine Prefix"),
+ QObject::tr("No Wine prefix has been configured for this instance.\n\n"
+ "A Wine prefix is required to run Windows games through "
+ "Proton.\n\n"
+ "To create one, go to:\n"
+ " Settings \u2192 Wine/Proton\n\n"
+ "Set the prefix location, then click \"Create Prefix\" "
+ "to generate a new prefix."));
+ } else {
+ dialogs::spawnFailed(parent, sp, e);
+ }
return -1;
}
|
