Skip to content

[autostart] autostart on Windows is removed after one boot #771

Open
@joshsharp

Description

@joshsharp

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:

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions