refactor: windows auto updater only works with signed app

This commit is contained in:
2025-07-11 03:26:04 +03:00
parent d917bff6ef
commit 789d666515

View File

@@ -18,7 +18,7 @@ pub(crate) async fn get_resource(
let bytes = response.bytes().await?; let bytes = response.bytes().await?;
let mut dest_file = AsyncFile::create(&full_path).await?; let mut dest_file = AsyncFile::create(&full_path).await?;
dest_file.write_all(&bytes).await?; dest_file.write_all(&bytes).await?;
println!("[AR] • File downloaded to: {:?}", full_path); tracing::info!("[AR] • File downloaded to: {:?}", full_path);
if auto_update_supported { if auto_update_supported {
let result = match os_type.to_lowercase().as_str() { let result = match os_type.to_lowercase().as_str() {
@@ -28,8 +28,8 @@ pub(crate) async fn get_resource(
}; };
match result { match result {
Ok(_) => println!("[AR] • File opened successfully!"), Ok(_) => tracing::info!("[AR] • File opened successfully!"),
Err(e) => eprintln!("[AR] • Failed to open file: {e}"), Err(e) => tracing::info!("[AR] • Failed to open file: {e}"),
} }
} }
@@ -44,7 +44,7 @@ async fn handle_windows_file(path: &PathBuf) -> Result<(), Box<dyn std::error::E
.to_lowercase(); .to_lowercase();
if filename.ends_with(".exe") || filename.ends_with(".msi") { if filename.ends_with(".exe") || filename.ends_with(".msi") {
println!("[AR] • Detected installer: {}", filename); tracing::info!("[AR] • Detected installer: {}", filename);
run_windows_installer(path).await run_windows_installer(path).await
} else { } else {
open_windows_folder(path).await open_windows_folder(path).await
@@ -67,10 +67,12 @@ async fn run_windows_installer(path: &PathBuf) -> Result<(), Box<dyn std::error:
}; };
if status.success() { if status.success() {
println!("[AR] • Installer started successfully."); tracing::info!("[AR] • Installer started successfully.");
Ok(()) Ok(())
} else { } else {
Err(format!("Installer failed. Exit code: {:?}", status.code()).into()) tracing::error!("Installer failed. Exit code: {:?}", status.code());
tracing::info!("[AR] • Trying to open folder...");
open_windows_folder(path).await
} }
} }