add self updater #1352

Manually merged
github merged 2 commits from gh-pr/1352/head into gh-pr/1352/base 2026-11-26 09:54:18 +00:00
Owner

@⁠Nmzik on GitHub · 2026-10-10 03:12 UTC · original
KytyPS5:add-self-updater → main · +1019 −113 · 12 files · 2 commits · merged 2026-10-10 03:42 UTC

No description provided.

**@⁠Nmzik** on GitHub · 2026-10-10 03:12 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1352) `KytyPS5:add-self-updater` → `main` · +1019 −113 · 12 files · 2 commits · merged 2026-10-10 03:42 UTC *No description provided.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:54:16 +00:00
github manually merged commit f1764a0bba into gh-pr/1352/base 2026-11-26 09:54:18 +00:00
github-bot referenced this pull request from a commit 2026-11-26 09:55:24 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-10 03:18 UTC · original · edited 2026-10-10 03:35 UTC

Review in Change Stack →Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1201eb0a-647d-41c1-9734-25a1dcfcd31a

📥 Commits

Reviewing files that changed from the base of the PR and between b41c23d338 and f1764a0bba.


📒 Files selected for processing (3)
  • .github/workflows/build.yml
  • src/launcher/CMakeLists.txt
  • src/updater/CMakeLists.txt

💤 Files with no reviewable changes (1)
  • src/launcher/CMakeLists.txt

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.



📝 Walkthrough

Walkthrough

The launcher now checks official release metadata and offers package installation or release notes. For installation, it downloads and verifies the selected package, extracts it, validates the payload with kyty_updater, and delegates replacement and restart to that executable. The launcher blocks game launches during installation and displays prior installer results. Build, installation, artifact verification, and release packaging now include the updater.

Suggested reviewers: cosmo


Priority: ➖ Normal

Change: Feature

Merge Risk: 🔵 Low · up to f1764

Some failed updates and successful Windows updates leave temporary updater workspaces behind, which can accumulate disk usage. This is a bounded cleanup issue; no broader merge-blocking failure was established.

Pre-merge checks | Passed 3 | Failed 1 | Inconclusive 1

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 5.80% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 69 functions across 10 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Inconclusive No pull request description was provided, so the change intent and implementation details are not documented in the description. Add a concise description of the self-updater, including its update-check, download, validation, installation, rollback, and restart behavior.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the main change: adding a self-updater to the application.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

Full details: Docstring Coverage

Explanation

Docstring coverage is 5.80% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 69 functions across 10 files. (3 skipped: 3 unsupported.)


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-10 03:18 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1352#issuecomment-6093230717) · edited 2026-10-10 03:35 UTC <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1352?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3#gh-light-mode-only" alt="Review in Change Stack →" height="32"></a><a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1352?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=3#gh-dark-mode-only" alt="Review in Change Stack →" height="32"></a> <!-- review_stack_entry_end --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary><strong>ℹ️ Recent review info</strong></summary> <dl> <dd> <details> <summary><strong>⚙️ Run configuration</strong></summary> <dl> <dd> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `1201eb0a-647d-41c1-9734-25a1dcfcd31a` <hr> </dd> </dl> </details> <details> <summary><strong>📥 Commits</strong></summary> <dl> <dd> Reviewing files that changed from the base of the PR and between b41c23d338fd3d81ba7b19814fdf40defa452958 and f1764a0bba4fcfea772ba95e4fa57376f4a61a49. <hr> </dd> </dl> </details> <details> <summary><strong>📒 Files selected for processing (3)</strong></summary> <dl> <dd> * `.github/workflows/build.yml` * `src/launcher/CMakeLists.txt` * `src/updater/CMakeLists.txt` <hr> </dd> </dl> </details> <details> <summary><strong>💤 Files with no reviewable changes (1)</strong></summary> <dl> <dd> * src/launcher/CMakeLists.txt <hr> </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. <hr> </dd> </dl> </details> --- <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary><strong>📝 Walkthrough</strong></summary> <dl> <dd> ## Walkthrough The launcher now checks official release metadata and offers package installation or release notes. For installation, it downloads and verifies the selected package, extracts it, validates the payload with `kyty_updater`, and delegates replacement and restart to that executable. The launcher blocks game launches during installation and displays prior installer results. Build, installation, artifact verification, and release packaging now include the updater. **Suggested reviewers:** `cosmo` <hr> </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ➖ Normal <!-- change_assessment_commit:"f1764a0bba4fcfea772ba95e4fa57376f4a61a49" --> **Change:** Feature <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** **🔵 Low** · up to `f1764` <!-- final_review_risk_coverage:{"sourceCommitId":"f1764a0bba4fcfea772ba95e4fa57376f4a61a49","coveredCommitId":"f1764a0bba4fcfea772ba95e4fa57376f4a61a49","kind":"reviewed"} --> Some failed updates and successful Windows updates leave temporary updater workspaces behind, which can accumulate disk usage. This is a bounded cleanup issue; no broader merge-blocking failure was established. <!-- final_review_risk_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks | <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v1.svg" width="14" height="17" align="middle" alt="Passed" title="Passed"></picture></sup> 3 | <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v1.svg" width="14" height="17" align="middle" alt="Failed" title="Failed"></picture></sup> 1 | <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-inconclusive-14-v1.svg" width="14" height="17" align="middle" alt="Inconclusive" title="Inconclusive"></picture></sup> 1</strong></summary> <dl> <dd> ### ❌ Failed checks (1 warning, 1 inconclusive) | Check name | Status | Explanation | Resolution | | :---------------- | :--------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------- | | Docstring Coverage | ![Warning](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-warning.svg) | Docstring coverage is 5.80% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 69 functions across 10 files. (3 skipped: … | Write docstrings for the functions missing them to satisfy the coverage threshold. | | Description check | ![Inconclusive](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-inconclusive.svg) | No pull request description was provided, so the change intent and implementation details are not documented in the description. | Add a concise description of the self-updater, including its update-check, download, validation, installation, rollback, and restart behavior. | <details> <summary><strong>✅ Passed checks (3 passed)</strong></summary> <dl> <dd> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title clearly identifies the main change: adding a self-updater to the application. | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | <hr> </dd> </dl> </details> <details> <summary><strong>Full details: Docstring Coverage</strong></summary> <dl> <dd> **Explanation** Docstring coverage is 5.80% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 69 functions across 10 files. (3 skipped: 3 unsupported.) </dd> </dl> </details> <hr> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts <!-- autopilot:end --> <!-- tips_start --> --- Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1352)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>❤️ Share</strong></summary> <dl> <dd> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) <hr> </dd> </dl> </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
@ -143,0 +228,4 @@
return;
}
m_workspace = std::make_unique<QTemporaryDir>(
QDir(directory).filePath(QStringLiteral(".kyty-update-XXXXXX")));
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-10 03:18 UTC · original

🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win

Remove stale .kyty-update-* workspaces before you create a new one.

Restart() calls setAutoRemove(false). After that call, only CleanupWorkspace in src/updater/main.cpp can delete the workspace. CleanupWorkspace runs only when Install succeeds and Launch succeeds.

The workspace stays in the installation folder in these cases:

  • WaitForParent times out.
  • Install fails. The workspace then still holds the downloaded package and the full rolled-back payload, often hundreds of MB.
  • Launch fails.
  • A successful update completes on Windows. The running kyty_updater.exe cannot be deleted. helper.log also stays because the helper holds it open as stdout/stderr.

No code removes these folders later. Each failed or Windows update leaves one more folder.

Remove stale workspaces in Download() before you create the new QTemporaryDir. The user starts Download(), so the previous helper has finished by then. Do not run this cleanup at startup. At startup, the helper can still be running its own cleanup. Keep .kyty-update-lock, because it holds backups for recovery. Keep .kyty-update-result too. Ignore removal errors.

🧹 Proposed fix
--- "a/src/launcher/src/updateChecker.cpp"
+++ "b/src/launcher/src/updateChecker.cpp"
@@ -227,8 +227,17 @@
 		          "extract it manually."));
 		return;
 	}
+	QDir install_dir(directory);
+	for (const auto& stale: install_dir.entryInfoList({QStringLiteral(".kyty-update-*")},
+	                                                   QDir::Dirs | QDir::Hidden | QDir::NoSymLinks |
+	                                                       QDir::NoDotAndDotDot)) {
+		if (stale.fileName() != QStringLiteral(".kyty-update-lock") &&
+		    stale.fileName() != QStringLiteral(".kyty-update-result")) {
+			QDir(stale.absoluteFilePath()).removeRecursively();
+		}
+	}
 	m_workspace = std::make_unique<QTemporaryDir>(
 	    QDir(directory).filePath(QStringLiteral(".kyty-update-XXXXXX")));
 	if (!m_workspace->isValid()) {
 		Finish(tr("The installation folder is not writable. Move KytyPS5 to a writable folder and "
 		          "try again."));
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

	QDir install_dir(directory);
	for (const auto& stale: install_dir.entryInfoList({QStringLiteral(".kyty-update-*")},
	                                                   QDir::Dirs | QDir::Hidden | QDir::NoSymLinks |
	                                                       QDir::NoDotAndDotDot)) {
		if (stale.fileName() != QStringLiteral(".kyty-update-lock") &&
		    stale.fileName() != QStringLiteral(".kyty-update-result")) {
			QDir(stale.absoluteFilePath()).removeRecursively();
		}
	}
	m_workspace = std::make_unique<QTemporaryDir>(
	    QDir(directory).filePath(QStringLiteral(".kyty-update-XXXXXX")));
**@⁠coderabbitai[bot]** on GitHub · 2026-10-10 03:18 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1352#discussion_r4236191332) **🚀 Performance & Scalability** | **🟡 Minor** | **⚡ Quick win** **Remove stale `.kyty-update-*` workspaces before you create a new one.** `Restart()` calls `setAutoRemove(false)`. After that call, only `CleanupWorkspace` in `src/updater/main.cpp` can delete the workspace. `CleanupWorkspace` runs only when `Install` succeeds and `Launch` succeeds. The workspace stays in the installation folder in these cases: - `WaitForParent` times out. - `Install` fails. The workspace then still holds the downloaded package and the full rolled-back payload, often hundreds of MB. - `Launch` fails. - A successful update completes on Windows. The running `kyty_updater.exe` cannot be deleted. `helper.log` also stays because the helper holds it open as stdout/stderr. No code removes these folders later. Each failed or Windows update leaves one more folder. Remove stale workspaces in `Download()` before you create the new `QTemporaryDir`. The user starts `Download()`, so the previous helper has finished by then. Do not run this cleanup at startup. At startup, the helper can still be running its own cleanup. Keep `.kyty-update-lock`, because it holds backups for recovery. Keep `.kyty-update-result` too. Ignore removal errors. <details> <summary>🧹 Proposed fix</summary> ```diff --- "a/src/launcher/src/updateChecker.cpp" +++ "b/src/launcher/src/updateChecker.cpp" @@ -227,8 +227,17 @@ "extract it manually.")); return; } + QDir install_dir(directory); + for (const auto& stale: install_dir.entryInfoList({QStringLiteral(".kyty-update-*")}, + QDir::Dirs | QDir::Hidden | QDir::NoSymLinks | + QDir::NoDotAndDotDot)) { + if (stale.fileName() != QStringLiteral(".kyty-update-lock") && + stale.fileName() != QStringLiteral(".kyty-update-result")) { + QDir(stale.absoluteFilePath()).removeRecursively(); + } + } m_workspace = std::make_unique<QTemporaryDir>( QDir(directory).filePath(QStringLiteral(".kyty-update-XXXXXX"))); if (!m_workspace->isValid()) { Finish(tr("The installation folder is not writable. Move KytyPS5 to a writable folder and " "try again.")); ``` </details> <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion QDir install_dir(directory); for (const auto& stale: install_dir.entryInfoList({QStringLiteral(".kyty-update-*")}, QDir::Dirs | QDir::Hidden | QDir::NoSymLinks | QDir::NoDotAndDotDot)) { if (stale.fileName() != QStringLiteral(".kyty-update-lock") && stale.fileName() != QStringLiteral(".kyty-update-result")) { QDir(stale.absoluteFilePath()).removeRecursively(); } } m_workspace = std::make_unique<QTemporaryDir>( QDir(directory).filePath(QStringLiteral(".kyty-update-XXXXXX"))); ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:186713785ddfc1be885b8571 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-10 03:18 UTC · original · reviewed

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 61512628-619c-4e21-8300-eb139582da1a
📥 Commits

Reviewing files that changed from the base of the PR and between 679be25c37 and b41c23d338.

📒 Files selected for processing (14)
  • .github/workflows/build.yml
  • README.md
  • src/launcher/CMakeLists.txt
  • src/launcher/include/updateChecker.h
  • src/launcher/include/updateRelease.h
  • src/launcher/src/mainDialog.cpp
  • src/launcher/src/updateChecker.cpp
  • src/launcher/src/updateRelease.cpp
  • src/updater/CMakeLists.txt
  • src/updater/UpdateInstaller.cpp
  • src/updater/UpdateInstaller.h
  • src/updater/main.cpp
  • tests/UpdateInstallerTests.cpp
  • tests/UpdateReleaseTests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-10 03:18 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1352#pullrequestreview-5477329515) · **reviewed** **Actionable comments posted: 1** --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `61512628-619c-4e21-8300-eb139582da1a` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 679be25c37bce0879402b387869fafc9090f0ccc and b41c23d338fd3d81ba7b19814fdf40defa452958. </details> <details> <summary>📒 Files selected for processing (14)</summary> * `.github/workflows/build.yml` * `README.md` * `src/launcher/CMakeLists.txt` * `src/launcher/include/updateChecker.h` * `src/launcher/include/updateRelease.h` * `src/launcher/src/mainDialog.cpp` * `src/launcher/src/updateChecker.cpp` * `src/launcher/src/updateRelease.cpp` * `src/updater/CMakeLists.txt` * `src/updater/UpdateInstaller.cpp` * `src/updater/UpdateInstaller.h` * `src/updater/main.cpp` * `tests/UpdateInstallerTests.cpp` * `tests/UpdateReleaseTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=2652a063-5ad3-40f0-aa8c-16b33394ae30 attempt=63f0228a-5f17-416e-9a63-0cfa7779c959 batch=1/1 -->
This discussion has been locked. Commenting is limited to contributors.
No description provided.