tauri-apps / tauri-apps/plugins-workspace

[autostart] autostart on Windows is removed after one boot

Open
#771 0 comments 0 reactions 0 assignees View on GitHub
platform: windows plugin: autostart
Dominant language
Rust
Stars
1.8k
Forks
602
Avg merge
4d 14h
Merged PRs (30d)
9

Description

Hi, I'm sorry but this is going to be a very vague bug report as I'm having trouble understanding what's happening.

I have been using autostart for a while with no issues and was using the `dev` branch as instructed, then started getting this issue. I moved to depending on `v1` branch but the issue persisted.

I've installed the plugin as described in the readme:

```rust
let app = tauri::Builder::default()
// snip lots of setup
.plugin(tauri_plugin_autostart::init(
MacosLauncher::LaunchAgent,
Some(vec!["--quiet"]),
))
.build(context)
.expect("error while building tauri application");
```

To turn it on, I call `enable()` in Javascript:

```javascript
import { enable, isEnabled, disable } from "tauri-plugin-autostart-api";

// later...
await enable();
```

Essentially what's happening is that upon calling `enable()` from the exposed JS module the registry entry is added on Windows successfully in the correct location and upon next boot the app is successfully launched at startup. However, somehow (upon launch of my app? upon registry of the plugin?) the Windows registry item in the `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run` location is somehow removed. If `enable()` isn't called again, the app will fail to run on next boot.

Thanks for your help.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.