This plugin allows Flutter desktop apps to Auto launch on startup / login.

Overview

launch_at_startup

pub version

This plugin allows Flutter desktop apps to Auto launch on startup / login.

Discord


Platform Support

Linux macOS Windows
✔️ ✔️ ✔️

⚠️ macOS only supports non-sandbox mode.

Quick Start

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  launch_at_startup: ^0.1.1

Or

dependencies:
  launch_at_startup:
    git:
      url: https://github.com/leanflutter/launch_at_startup.git
      ref: main

Usage

import 'dart:io';

import 'package:launch_at_startup/launch_at_startup.dart';
import 'package:package_info_plus/package_info_plus.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  PackageInfo packageInfo = await PackageInfo.fromPlatform();

  LaunchAtStartup.instance.setup(
    appName: packageInfo.appName,
    appPath: Platform.resolvedExecutable,
  );

  
  await LaunchAtStartup.instance.enable();
  await LaunchAtStartup.instance.disable();
  bool isEnabled = await LaunchAtStartup.instance.isEnabled();

  runApp(const MyApp());
}

// ...

Please see the example app of this plugin for a full example.

License

MIT License

Copyright (c) 2021 LiJianying 
   
    

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

   
Comments
  • win32_registry bump

    win32_registry bump

    Would you consider bumping the major version of win32_registry if it doesn't break anything in your package? If you need I could take time to do it myself, if you accept PRs.

    opened by guillaumeboehm 2
  • fix: use correct max length of registry key

    fix: use correct max length of registry key

    I have very little knowledge about windows registry, but it seems like _kRegValueMaxLength was incorrect for some path. I changed it to codeUnits length multiplied by 2, so there is no space left for some random bytes.

    opened by jakub-stefaniak 2
  • flutter build web error

    flutter build web error

    Error: Only JS interop members may be 'external'.
      external int wBitsPerSample;
    ....
    ....
    /D:/tmp/.pub/cache/hosted/pub.flutter-io.cn/win32-2.3.1/lib/src/combase.dart:24:37:
    Error: Only JS interop members may be 'external'.
      external Pointer<Pointer<IntPtr>> lpVtbl;
                                        ^
    Error: Compilation failed.
    
    opened by sleepreading 2
  • [macOs] Unhandled Exception: FileSystemException: Cannot open file, path = '/Users/username/Library/Containers/com.example.packagename/Data/Library/LaunchAgents/AppName.plist' (OS Error: No such file or directory, errno = 2)

    [macOs] Unhandled Exception: FileSystemException: Cannot open file, path = '/Users/username/Library/Containers/com.example.packagename/Data/Library/LaunchAgents/AppName.plist' (OS Error: No such file or directory, errno = 2)

    [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: FileSystemException: Cannot open file, path = '/Users/username/Library/Containers/com.example.packagename/Data/Library/LaunchAgents/AppName.plist' (OS Error: No such file or directory, errno = 2) #0 _File.throwIfError (dart:io/file_impl.dart:635:7) #1 _File.openSync (dart:io/file_impl.dart:479:5) #2 _File.writeAsBytesSync (dart:io/file_impl.dart:604:31) #3 _File.writeAsStringSync (dart:io/file_impl.dart:628:5) #4 AppAutoLauncherImplMacOS.enable package:launch_at_startup/src/app_auto_launcher_impl_macos.dart:37 #5 LaunchAtStartup.enable package:launch_at_startup/src/launch_at_startup.dart:34 #6 main package:home_services/main.dart:49

    opened by newnishad 1
  • Fix incorrect setting/checking of registry value

    Fix incorrect setting/checking of registry value

    enable() has a bug in the case of an empty arg array. In that case an extra empty space will be added to the registry appPath value.

    isEnabled() has a bug in all cases, because appPath will never match the set value (due to the extra space described above).

    opened by ChristianEdwardPadilla 1
  • [windows] isEnabled is not working when args are passed

    [windows] isEnabled is not working when args are passed

    https://github.com/leanflutter/launch_at_startup/blob/main/lib/src/app_auto_launcher_impl_windows.dart#:~:text=String%3F%20value,value%20%3D%3D%20appPath%3B

    The path returned by reg. will contain the concatenated args and comparing it with app path will never gives true

    Also there should be check that if no args is passed then path should not be joined with args, this is adding an extra space to the path string. Due to this disabling of auto launch is failing

    opened by anurag-MANIT 1
  • web compile error

    web compile error

    import 'package:launch_at_startup/launch_at_startup.dart';
    ...
    if (!isDesktop) { // just want to skip those codes when non-desktop
       return;
    }
    LaunchAtStartup.instance.setup(...)
    ...
    

    When I compile the project for web, cause this error: aunch_at_startup-0.1.9/lib/src/launch_at_startup.dart:41:9: Error: No named parameter with the name 'args'.

    opened by sleepreading 0
  • launch_at_startup not working on kde neon (ubuntu)

    launch_at_startup not working on kde neon (ubuntu)

    HI,

    launch_at_startup is not working on kde neon 5.26 (ubuntu) on auto login (https://www.simplified.guide/kde/automatic-login)

    it works after logout and login,

    but App name is entered in Autostart settings,

    opened by srkrishnan1989 0
  • feat: add interactive process type to MacOS

    feat: add interactive process type to MacOS

    Adds interactive process type to MacOS daemon for responsive user experience. Without this, the Flutter MacOS app seems to be a bit laggy/unresponsive (e.g. when animating) when launched at startup as by default the system throttles CPU and I/O usage for the app.

    Interactive jobs run with the same resource limitations as apps, that is to say, none. Interactive jobs are critical to maintaining a responsive user experience, and this key should only be used if an app's ability to be responsive depends on it, and cannot be made Adaptive.

    Reference: https://www.manpagez.com/man/5/launchd.plist/.

    opened by bselwe 0
  • [windows] Add MSIX app support

    [windows] Add MSIX app support

    The issue is when I enable launch at startup for my app which is installed using MSIX, literally nothing happens. I found a workaround, which is running a batch / ps script to remove / add app shortcut to startup apps:

    @echo off
    SET currentDirectory=%~dp0
    PUSHD %currentDirectory%
    CD ..
    CD ..
    CD ..
    CD ..
    SET MNIST_DIR=%CD%
    SET appExeDir=%MNIST_DIR%
    powershell "$s=(New-Object -COM WScript.Shell).CreateShortcut('%userprofile%\Start Menu\Programs\Startup\WTNews.lnk');$s.TargetPath='%appExeDir%\wtnews.exe';$s.Arguments='connect';$s.IconLocation='%userprofile%\Start Menu\Programs\WTNews.lnk';$s.WorkingDirectory='%appExeDir%';$s.WindowStyle=7;$s.Save()"
    

    This works without a flaw, and isEnabled and isDisabled booleans can return existence of the shortcut.

    opened by Vonarian 2
Releases(v0.1.9)
Owner
LeanFlutter
To make the flutter even simpler
LeanFlutter
This plugin allows Flutter desktop apps to defines system/inapp wide hotkey (i.e. shortcut).

hotkey_manager This plugin allows Flutter desktop apps to defines system/inapp wide hotkey (i.e. shortcut). hotkey_manager Platform Support Quick Star

LeanFlutter 82 Jan 6, 2023
SKSE plugin for replacing Skyrim SE shaders at launch.

Plugin for SSE Parallax Shader Fix. Requirements CMake Add this to your PATH PowerShell Vcpkg Add the environment variable VCPKG_ROOT with the value a

null 8 Nov 30, 2022
A Flutter package that makes it easy to customize and work with your Flutter desktop app's system tray.

system_tray A Flutter package that that enables support for system tray menu for desktop flutter apps. on Windows, macOS and Linux. Features: - Modify

AnTler 140 Dec 30, 2022
Filter and launch links in a browser of your choice!

Link Launcher Filter links with regular expressions and launch them into your favourite browsers Have you ever wanted to open a youtube link from othe

null 5 Aug 20, 2021
Windows file startup creator write in c++

startup-creator Language Simple program written in c++, for you to place your programs at windows startup. ?? Requirements Latest Mingw-64 or Mingw-32

Dio brando 6 Jan 22, 2022
OpenGL Template Engine - a C++ OpenGL graphics engine which aimed to be a simple startup template for 3D OpenGL projects.

OpenGL Template Engine is a C++ OpenGL graphics engine which aimed to be a simple startup template for 3D OpenGL projects. This is the template I personally use for my own projects and provides me with the general OpenGL 3D render setup with model import and UI.

Marcus Nesse Madland 2 May 16, 2022
SDK for building cross-platform desktop apps in ANSI-C

NAppGUI Cross-Platform C SDK. Build portable desktop applications for Windows, macOS and Linux, using just C. Quick start in Windows Prerequisites Vis

Francisco García Collado 242 Jan 2, 2023
Native context menu for Flutter apps

native_context_menu Native context menu for flutter apps Installation flutter pub add native_context_menu Usage import 'package:native_context_menu/na

Andrei Lesnitsky 151 Dec 22, 2022
An app that allows you to edit/create apps in Dash

AppAdder On Ubuntu, have you ever run a program or AppImage and the app not had an icon? This is a personal pet peeve. I've used AppImageLauncher to i

Camden 5 Jun 25, 2022
Flutter-Clock-and-Reminder-App - a highly functional clock and reminder app developed on flutter framework.

clock_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

Umar Baloch 6 Aug 4, 2022
The package allows to use H3 library directly in your Flutter application

The package allows to use H3 library directly in your Flutter application

Ilya Beregovskiy 12 Dec 21, 2022
Steals plaguecheat.cc login information and sends them over Discord webhook

PlagueStealer DO NOT USE THIS!!! I TAKE NO RESPONSIBILITY FOR ANY DAMAGE CAUSED How to use: Make a Discord webhook (watch this if you dont know how: h

Sinner 3 Dec 28, 2021
Login & Registration system using leveldb in C++

LoginAndRegistration ?? Clone repo git clone https://github.com/dev-cetus/LoginAndRegistration.git cd LoginAndRegistration ?? Install leveldb via vcp

Cetus 3 Nov 23, 2022
Creates an XDG_RUNTIME_DIR on login and never removes it.

dumb_runtime_dir Creates an XDG_RUNTIME_DIR directory on login per the freedesktop.org base directory spec. Flaunts the spec and never removes it, eve

Isaac Freund 19 Dec 9, 2022
REGISTRATION / LOGIN SYSTEM USING C++

REGISTRATION / LOGIN SYSTEM USING C++ Used File Handling / Manipulations / Storing extensively.

null 0 Feb 6, 2022
This is a imgui login that runs with keyauth with only uses the key and has tabs for you to paste your stuff in c++

KeyAuth-Imgui-key-Login This is a imgui login that runs with keyauth with only uses the key and has tabs for you to paste your stuff in c++ KeyAuth CP

Lucent 12 Dec 16, 2022
A desktop (supports macOS and Windows) implementation of uni_links plugin.

uni_links_desktop A desktop (supports macOS and Windows) implementation of uni_links plugin. uni_links_desktop Platform Support Quick Start Installati

LeanFlutter 18 Dec 2, 2022
A cross-platform (Android/iOS/Windows/macOS) cronet plugin for Flutter via `dart:ffi`

cronet_flutter A cross-platform (Android/iOS/Windows/macOS) cronet plugin for Flutter via dart:ffi

null 25 Dec 11, 2022
A Flutter Web Plugin to display Text Widget as Html for SEO purpose

SEO Renderer A flutter plugin (under development) to render text widgets as html elements for SEO purpose. Created specifically for issue https://gith

Sahdeep Singh 103 Nov 21, 2022