index.js 644 B

1234567891011121314151617181920
  1. const { app, utilityProcess } = require('electron');
  2. const path = require('node:path');
  3. app.whenReady().then(() => {
  4. if (process.env.NODE_OPTIONS &&
  5. process.env.NODE_OPTIONS.trim() === '--allow-addons --allow-addons') {
  6. const child = utilityProcess.fork(path.join(__dirname, 'options.js'), [], {
  7. stdio: 'inherit',
  8. env: {
  9. NODE_OPTIONS: `--allow-addons --require ${path.join(__dirname, 'preload.js')} --enable-fips --allow-addons --enable-fips`,
  10. ELECTRON_ENABLE_STACK_DUMPING: 'true'
  11. }
  12. });
  13. child.once('exit', (code) => code ? app.exit(1) : app.quit());
  14. } else {
  15. app.exit(1);
  16. }
  17. });