aboutsummaryrefslogtreecommitdiff
path: root/src/update.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-07 16:47:20 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-07 16:47:20 +0300
commit7c7d8c8619006b25244bcdac0abc560cd43108ab (patch)
tree7566b4698a002aba909fed7eeb5ef78d104f5df0 /src/update.rs
parent0956ad8c5883014ebf88664099fae41edd3fdc9e (diff)
fix: gate windows updater checks
Diffstat (limited to 'src/update.rs')
-rw-r--r--src/update.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/update.rs b/src/update.rs
index 6b428b78..3337d6e9 100644
--- a/src/update.rs
+++ b/src/update.rs
@@ -8,6 +8,7 @@
use std::collections::BTreeMap;
use std::env;
+#[cfg(not(windows))]
use std::fs;
use std::io::{self, BufRead, BufReader, IsTerminal, Write};
use std::path::{Path, PathBuf};
@@ -519,11 +520,13 @@ fn check_homebrew_latest() -> Result<Option<Version>, String> {
// Download + install
// ---------------------------------------------------------------------------
+#[cfg(not(windows))]
struct DownloadedUpdate {
current_exe: PathBuf,
tmp_path: Option<PathBuf>,
}
+#[cfg(not(windows))]
impl Drop for DownloadedUpdate {
fn drop(&mut self) {
if let Some(tmp_path) = self.tmp_path.take() {
@@ -533,6 +536,7 @@ impl Drop for DownloadedUpdate {
}
/// Download a release to a prepared executable temp file without touching the running server.
+#[cfg(not(windows))]
fn download_update(release: &ReleaseInfo) -> Result<DownloadedUpdate, String> {
let current_exe = env::current_exe().map_err(|e| format!("can't find current binary: {e}"))?;
@@ -592,6 +596,7 @@ fn download_update(release: &ReleaseInfo) -> Result<DownloadedUpdate, String> {
})
}
+#[cfg(not(windows))]
fn install_downloaded_update(mut update: DownloadedUpdate) -> Result<(), String> {
let tmp_path = update
.tmp_path
@@ -1955,6 +1960,9 @@ pub fn self_update(options: SelfUpdateOptions) -> Result<Version, String> {
"installing {} with the Windows installer...",
release.label()
);
+ if let Some(sha256) = &release.sha256 {
+ tracing::debug!(sha256 = %sha256, "selected Windows update asset has checksum");
+ }
install_windows_update_with_installer(channel)?;
let updated_exe = windows_installed_herdr_exe_path()?;
eprintln!("installed {}", release.label());
@@ -1971,8 +1979,6 @@ pub fn self_update(options: SelfUpdateOptions) -> Result<Version, String> {
print_outdated_integration_notice_with_updated_binary(&updated_exe);
print_running_session_update_outcomes(&server_update_outcomes, &release);
-
- return Ok(release.version);
}
#[cfg(not(windows))]