fix(update): stamp the installed release so it is not offered twice

The checkout path installed with the build's configured prefix instead of
installing into the directory holding the running copy, so the binary in use
and its version marker both stayed at the old release: the app kept reporting
that version and offered the same update again at every launch.

Every method now stages and installs into the running binary's directory, the
install step writes the release it just installed next to the binary, and
currentVersion() reads the version compiled into the running build first,
falling back to the marker file. The repo-root `version` file stays the single
source of truth: CMake compiles it in.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
BlackAngelTV committed 2026-09-12 22:19:47 +02:00
1 parent 632cdf1dea
commit 5756704b03
5 files changed
+132 -42

No files matched your search

+3 -2
View File
@@ -3009,10 +3009,11 @@ void MainWindow::onUpdateCheckFinished(bool hasUpdate, const QString& latestVers
}
// Prompt for the sudo password only when the update must write into a
// root-owned directory (e.g. /usr/bin). Only the final copy is privileged:
// root-owned directory (e.g. /usr/bin). Every method installs into the
// running binary's directory, and only that final copy is privileged:
// everything else builds in a temp directory owned by the user.
QString sudoPassword;
if (m_updateManager->repoPath().isEmpty() && !QFileInfo(targetDir).isWritable()
if (!QFileInfo(targetDir).isWritable()
&& m_pacman && m_pacman->isAvailable()) {
bool ok = false;
sudoPassword = QInputDialog::getText(