Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: autolauncher-edge-case #1587

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src-tauri/src/auto_launcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ impl AutoLauncher {
auto_launcher.enable()?;
// To startup application as admin on windows, we need to create a task scheduler
#[cfg(target_os = "windows")]
self.toggle_windows_admin_auto_launcher(true).await?;
let _unused = self.toggle_windows_admin_auto_launcher(true).await.inspect_err(|e| {
warn!(target: LOG_TARGET, "Failed to enable admin auto-launcher: {}", e)
});
}
_ => {
auto_launcher.enable()?;
Expand All @@ -126,7 +128,9 @@ impl AutoLauncher {
match PlatformUtils::detect_current_os() {
CurrentOperatingSystem::Windows => {
#[cfg(target_os = "windows")]
self.toggle_windows_admin_auto_launcher(false).await?;
let _unused = self.toggle_windows_admin_auto_launcher(false).await.inspect_err(|e| {
warn!(target: LOG_TARGET, "Failed to disable admin auto-launcher: {}", e)
});
auto_launcher.disable()?;
}
_ => {
Expand Down
5 changes: 3 additions & 2 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,10 @@ async fn setup_inner(
let mm_proxy_manager = state.mm_proxy_manager.clone();

let is_auto_launcher_enabled = state.config.read().await.should_auto_launch();
AutoLauncher::current()
let _unused = AutoLauncher::current()
.initialize_auto_launcher(is_auto_launcher_enabled)
.await?;
.await
.inspect_err(|e| error!(target: LOG_TARGET, "Could not initialize auto launcher: {:?}", e));

let (tx, rx) = watch::channel("".to_string());
let progress = ProgressTracker::new(app.clone(), Some(tx));
Expand Down
Loading