Socket
Book a DemoInstallSign in
Socket

electron-winstore-auto-launch

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-winstore-auto-launch

Configure your Electron to start automatically when the user logs in Edit

2.0.6
latest
Source
npmnpm
Version published
Weekly downloads
554
128.93%
Maintainers
2
Weekly downloads
 
Created
Source

electron-winstore-auto-launch

This is a convenience module allowing for easy configuration of startup tasks for Windows Store apps written with Electron. Basically, it allows you either enable or disable the automatic launch of your app when the user logs in.

Usage

Before you can use this module, you need to add an <Extension> to your appxmanifest.xml. An app must register for the windows.startup extension category in its manifest to be activated at startup or when a user logs in.

<?xml version="1.0" encoding="utf-8"?>
<Package
  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
  xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
  IgnorableNamespaces="uap uap3">
  ...
  <Applications>
    <Application Id="Slack" Executable="app\Slack.exe" EntryPoint="Windows.FullTrustApplication">
      ...
      <Extensions>
        <desktop:Extension
          Category="windows.startupTask"
          Executable="app\Slack.exe"
          EntryPoint="Windows.FullTrustApplication">
          <desktop:StartupTask TaskId="SlackStartup" Enabled="true" DisplayName="Slack" />
        </desktop:Extension>
      </Extensions>
    </Application>
  </Applications>
</Package>

This module assumes that you have just one startup task. If you have more than one, it'll automatically use the first one.

The module exports one single static class WindowsStoreAutoLaunch with three main methods:

import { WindowsStoreAutoLaunch } from 'electron-winstore-auto-launch';

// Attempts to enable the task
WindowsStoreAutoLaunch.enable()

// Attempts to disable the task
WindowsStoreAutoLaunch.disable()

// Returns the current status of the task
WindowsStoreAutoLaunch.getStatus()

The status can be disabled (0), disabledByUser (1), or enabled (2). If the app's startup task was disabled by the user in the task manager, it can no longer be programmatically enabled.

The module also exports these helper methods:

import { WindowsStoreAutoLaunch } from 'electron-winstore-auto-launch';

// Returns an IList/Array of all startupTasks registered in the manifest
WindowsStoreAutoLaunch.getStartupTasks()

// Returns the first found startupTask
WindowsStoreAutoLaunch.getStartupTask()

License

MIT, please see LICENSE for details.

Keywords

windows

FAQs

Package last updated on 26 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.