Skip to content

Launch applications or executables at login (Mac, Windows, and Linux)

Notifications You must be signed in to change notification settings

GPMDP/node-auto-launch

 
 

Repository files navigation

node-auto-launch

NPM version Build Status Windows Build Status Dependency Status


Launch applications or executables at login (Mac, Windows and Linux). Perfect for NW.js and Electron apps.

Installation

npm install auto-launch

Usage

The API consists only of enable, disable, and isEnabled.

var AutoLaunch = require('auto-launch');

var minecraftAutoLauncher = new AutoLaunch({
	name: 'Minecraft',
	path: '/Applications/Minecraft.app',
	isHidden: true
});

minecraftAutoLauncher.enable();
//minecraftAutoLauncher.disable();

For NW.js or Electron apps you don't have to specify the path. It gets read from process.execPath :)

var AutoLaunch = require('auto-launch');

var appLauncher = new AutoLaunch({
	name: 'My NW.js or Electron app'
});

appLauncher.isEnabled().then(function(enabled){
	if(enabled) return;
	return appLauncher.enable()
}).then(function(err){
	
});

Note: I added a method (removeNwjsLoginItem) to remove 'nwjs helper' app login item that might have been added to peoples accounts since the name change from node-webkit to NW.js.

TODO:

  • Add getCurrentPath - So you can check if the app has moved around.

About

Launch applications or executables at login (Mac, Windows, and Linux)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CoffeeScript 100.0%