mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Install directory menus
This commit is contained in:
@@ -30,6 +30,8 @@ exports.existsSync = ->
|
||||
|
||||
installContextMenu = (callback) ->
|
||||
fileKeyPath = 'HKCU\\Software\\Classes\\*\\shell\\Atom'
|
||||
directoryKeyPath = 'HKCU\\Software\\Classes\\directory\\shell\\Atom'
|
||||
backgroundKeyPath = 'HKCU\\Software\\Classes\\directory\\background\\shell\\Atom'
|
||||
|
||||
spawnReg = (args, callback) ->
|
||||
args.unshift('add')
|
||||
@@ -42,6 +44,18 @@ installContextMenu = (callback) ->
|
||||
error?.code ?= code
|
||||
callback(error)
|
||||
|
||||
installMenu = (keyPath, callback) ->
|
||||
args = [keyPath, '/ve', '/d', 'Open with Atom', '/f']
|
||||
spawnReg args, ->
|
||||
args = [keyPath, '/v', 'Icon', '/d', process.execPath, '/f']
|
||||
spawnReg args, ->
|
||||
args = ["#{keyPath}\\command", '/ve', '/d', process.execPath, '/f']
|
||||
spawnReg(args, callback)
|
||||
|
||||
installMenu fileKeyPath, ->
|
||||
installMenu directoryKeyPath, ->
|
||||
installMenu(backgroundKeyPath, callback)
|
||||
|
||||
installFileMenu = (callback) ->
|
||||
args = [fileKeyPath, '/ve', '/d', 'Open with Atom', '/f']
|
||||
spawnReg args, (error) ->
|
||||
|
||||
Reference in New Issue
Block a user