Skip to content

Commit

Permalink
Fix hiddenArg not working on windows. Closes #31
Browse files Browse the repository at this point in the history
  • Loading branch information
razzeee committed Sep 12, 2016
1 parent a88e756 commit 66ae7df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/AutoLaunchWindows.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ module.exports =
enable: (opts) ->
new Promise (resolve, reject) ->
appPath = opts.appPath
hiddenArg = if opts.isHiddenOnLaunch then ' --hidden' else ''
arg = ""
updateDotExe = path.join(path.dirname(process.execPath), '..', 'update.exe')
versions = process?.versions
if fs.existsSync(updateDotExe) and versions.electron
appPath = updateDotExe
arg = " --processStart \"#{path.basename(process.execPath)}\""
hiddenArg = if opts.isHiddenOnLaunch then ' --hidden' else ''
hiddenArg = if opts.isHiddenOnLaunch then ' --process-start-args "--hidden"' else ''
regKey.set opts.appName, Winreg.REG_SZ, "\"#{appPath}\"#{arg}#{hiddenArg}", (err) ->
return reject(err) if err?
resolve()
Expand Down

0 comments on commit 66ae7df

Please sign in to comment.