preferences.js 854 B

123456789101112131415161718192021222324252627282930313233343536
  1. 'use strict';
  2. const is = require('electron-is');
  3. const config = require('./config');
  4. const shortcut = require('./lib/shortcut');
  5. const tray = require('./lib/tray');
  6. const awaken = require('./lib/awaken');
  7. const security = require('./lib/security');
  8. const chromeExtension = require('./lib/chromeExtension');
  9. module.exports = async () => {
  10. // shortcut
  11. shortcut.setup();
  12. // tray
  13. tray.setup();
  14. // awaken
  15. awaken.setup();
  16. // security
  17. security.setup();
  18. // chrome extension
  19. await chromeExtension.setup();
  20. // check update
  21. const updateConfig = config.get('autoUpdate');
  22. if (updateConfig.force) {
  23. if ((is.windows() && updateConfig.windows) || (is.macOS() && updateConfig.macOS)
  24. || (is.linux() && updateConfig.linux)) {
  25. const autoUpdater = require('./lib/autoUpdater');
  26. autoUpdater.checkUpdate();
  27. }
  28. }
  29. }