function startAria2 () {
  const AppData = require('./appdata').default
  const spawn = require('child_process').spawn
  const join = require('path').join
  const platform = require('os').platform()
  const homedir = require('os').homedir()
  const datadir = AppData.dir()
  const root = join(__static, 'aria2').replace('app.asar', 'app.asar.unpacked')
  const aria2c = platform === 'linux' ? 'aria2c' : join(root, platform, 'aria2c')
  const conf = join(root, 'aria2.conf')
  const session = join(datadir, 'aria2.session')

  if (aria2c !== 'aria2c') AppData.makeExecutable(aria2c)
  AppData.makeDir(datadir)
  AppData.touchFile(session)

  let options = Object.assign({
    'input-file': session,
    'save-session': session,
    'dht-file-path': join(datadir, 'dht.dat'),
    'dht-file-path6': join(datadir, 'dht6.dat'),
    'quiet': 'true'
  }, AppData.readData() || {})
  if (!options.hasOwnProperty('dir')) options['dir'] = join(homedir, 'Downloads')

  let args = ['--conf-path="' + conf + '"']
  for (let key in options) {
    args.push('--' + key + '="' + options[key] + '"')
  }
  return spawn(aria2c, args, {shell: true}, (error, stdout, stderr) => {
    if (error) {
      console.error(error.message)
      const message = 'conflicts with an existing aria2 instance. Please stop the instance and reopen the app.'
      dialog.showErrorBox('Warning', message)
      app.quit()
    }
  })
}
Auto Updater

Uncomment the following code below and install `electron-updater` to
support auto updating. Code Signing with a valid certificate is required.
https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-electron-builder.html#auto-updating