diff --git a/package-lock.json b/package-lock.json index 2cfb2d4..b06410b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "auto-launch", - "version": "5.0.2", + "version": "5.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/AutoLaunchWindows.coffee b/src/AutoLaunchWindows.coffee index 0c5de6e..f62c070 100644 --- a/src/AutoLaunchWindows.coffee +++ b/src/AutoLaunchWindows.coffee @@ -16,8 +16,11 @@ module.exports = # :appName - {String} # :appPath - {String} # :isHiddenOnLaunch - {Boolean} + # :onlyMe - (Optional) {Boolean} # Returns a Promise - enable: ({appName, appPath, isHiddenOnLaunch}) -> + enable: ({appName, appPath, isHiddenOnLaunch,onlyMe}) -> + if(!onlyMe) + regKey.hive = Winreg.HKLM return new Promise (resolve, reject) -> pathToAutoLaunchedApp = appPath args = '' @@ -38,8 +41,11 @@ module.exports = # appName - {String} + # onlyMe - (Optional) {Boolean} # Returns a Promise - disable: (appName) -> + disable: (appName,onlyMe) -> + if(!onlyMe) + regKey.hive = Winreg.HKLM return new Promise (resolve, reject) -> regKey.remove appName, (err) -> if err? @@ -52,8 +58,11 @@ module.exports = # appName - {String} + # onlyMe - (Optional) {Boolean} # Returns a Promise which resolves to a {Boolean} - isEnabled: (appName) -> + isEnabled: (appName,mac,onlyMe) -> + if(!onlyMe) + regKey.hive = Winreg.HKLM return new Promise (resolve, reject) -> regKey.get appName, (err, item) -> return resolve false if err? diff --git a/src/index.coffee b/src/index.coffee index 4a01536..6586848 100644 --- a/src/index.coffee +++ b/src/index.coffee @@ -12,13 +12,14 @@ module.exports = class AutoLaunch # to add Login Item # :name - {String} # :path - (Optional) {String} - constructor: ({name, isHidden, mac, path}) -> + constructor: ({name, isHidden, mac, path,onlyMe}) -> throw new Error 'You must specify a name' unless name? @opts = appName: name isHiddenOnLaunch: if isHidden? then isHidden else false - mac: mac ? {} + mac: mac ? {}, + onlyMe:onlyMe?true versions = process?.versions if path? @@ -48,11 +49,11 @@ module.exports = class AutoLaunch enable: => @api.enable @opts - disable: => @api.disable @opts.appName, @opts.mac + disable: => @api.disable @opts.appName, @opts.mac,@opts.onlyMe # Returns a Promise which resolves to a {Boolean} - isEnabled: => @api.isEnabled @opts.appName, @opts.mac + isEnabled: => @api.isEnabled @opts.appName, @opts.mac,@opts.onlyMe ### Private ###