aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-05-23 14:12:32 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-05-23 14:12:32 -0500
commit523aa754ee3d6700f9b828f4f55a4fce9018f06f (patch)
tree0aa5b4e488fd04453fbd56e3d9426fee8154653e
parentde4e588e2d76a285381061fdfbd74a57f6593ffd (diff)
prefix: describe installer exit codes
-rw-r--r--src/src/prefixsetuprunner.cpp36
-rw-r--r--src/src/prefixsetuprunner.h1
2 files changed, 30 insertions, 7 deletions
diff --git a/src/src/prefixsetuprunner.cpp b/src/src/prefixsetuprunner.cpp
index 2233160..5ac809b 100644
--- a/src/src/prefixsetuprunner.cpp
+++ b/src/src/prefixsetuprunner.cpp
@@ -1381,8 +1381,8 @@ bool PrefixSetupRunner::stepVcrun2022()
rc = runProcess(m_wineBin, {x86Path, "/install", "/quiet", "/norestart"}, env);
if (!isMicrosoftInstallerSuccess(rc)) {
currentStep().errorMessage =
- QStringLiteral("vc_redist.x86.exe failed (exit code %1, SHA256 %2)")
- .arg(rc)
+ QStringLiteral("vc_redist.x86.exe failed (%1, SHA256 %2)")
+ .arg(describeInstallerExitCode(rc))
.arg(fileSha256(x86Path));
return false;
} else if (rc != 0) {
@@ -1424,8 +1424,8 @@ bool PrefixSetupRunner::stepVcrun2022()
rc = runProcess(m_wineBin, {x64Path, "/install", "/quiet", "/norestart"}, env);
if (!isMicrosoftInstallerSuccess(rc)) {
currentStep().errorMessage =
- QStringLiteral("vc_redist.x64.exe failed (exit code %1, SHA256 %2)")
- .arg(rc)
+ QStringLiteral("vc_redist.x64.exe failed (%1, SHA256 %2)")
+ .arg(describeInstallerExitCode(rc))
.arg(fileSha256(x64Path));
return false;
} else if (rc != 0) {
@@ -1506,7 +1506,8 @@ bool PrefixSetupRunner::stepDotNetInstallPair(const QString& url32, const QStrin
const int rc = runProcess(m_wineBin, {path, "/install", "/quiet", "/norestart"}, env);
if (!isMicrosoftInstallerSuccess(rc)) {
currentStep().errorMessage =
- QStringLiteral("%1 x86 installer failed (exit code %2)").arg(name).arg(rc);
+ QStringLiteral("%1 x86 installer failed (%2)")
+ .arg(name, describeInstallerExitCode(rc));
return false;
} else if (rc != 0) {
emit logMessage(QStringLiteral("%1 x86 installer returned nonfatal exit code %2")
@@ -1537,7 +1538,8 @@ bool PrefixSetupRunner::stepDotNetInstallPair(const QString& url32, const QStrin
const int rc = runProcess(m_wineBin, {path, "/install", "/quiet", "/norestart"}, env);
if (!isMicrosoftInstallerSuccess(rc)) {
currentStep().errorMessage =
- QStringLiteral("%1 x64 installer failed (exit code %2)").arg(name).arg(rc);
+ QStringLiteral("%1 x64 installer failed (%2)")
+ .arg(name, describeInstallerExitCode(rc));
return false;
} else if (rc != 0) {
emit logMessage(QStringLiteral("%1 x64 installer returned nonfatal exit code %2")
@@ -1582,7 +1584,8 @@ bool PrefixSetupRunner::stepDotNetInstall(const QString& url, const QString& nam
if (!isMicrosoftInstallerSuccess(rc)) {
currentStep().errorMessage =
- QStringLiteral("%1 installer failed (exit code %2)").arg(name).arg(rc);
+ QStringLiteral("%1 installer failed (%2)")
+ .arg(name, describeInstallerExitCode(rc));
return false;
} else if (rc != 0) {
emit logMessage(QStringLiteral("%1 installer returned nonfatal exit code %2")
@@ -2317,6 +2320,25 @@ bool PrefixSetupRunner::isMicrosoftInstallerSuccess(int exitCode)
return exitCode == 0 || exitCode == 105 || exitCode == 194 || exitCode == 236;
}
+QString PrefixSetupRunner::describeInstallerExitCode(int exitCode)
+{
+ switch (exitCode) {
+ case 5:
+ return QStringLiteral("exit code 5: installer was cancelled or access was denied");
+ case 112:
+ return QStringLiteral(
+ "exit code 112: not enough disk space in the prefix or target filesystem");
+ case 105:
+ return QStringLiteral("exit code 105: installer requested restart now");
+ case 194:
+ return QStringLiteral("exit code 194: installer requested restart later");
+ case 236:
+ return QStringLiteral("exit code 236: newer version is already installed");
+ default:
+ return QStringLiteral("exit code %1").arg(exitCode);
+ }
+}
+
SetupStep& PrefixSetupRunner::currentStep()
{
if (m_currentStepIndex >= 0 && m_currentStepIndex < m_steps.size())
diff --git a/src/src/prefixsetuprunner.h b/src/src/prefixsetuprunner.h
index 3eda26c..88c65ec 100644
--- a/src/src/prefixsetuprunner.h
+++ b/src/src/prefixsetuprunner.h
@@ -151,6 +151,7 @@ private:
const QStringList& native,
const QStringList& nativeBuiltin);
static bool isMicrosoftInstallerSuccess(int exitCode);
+ static QString describeInstallerExitCode(int exitCode);
SetupStep& currentStep();
/// Kill any wineboot/wineserver/pv-adverb processes still bound to