Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var height = 200;
// Electron app
const electron = require('electron');
const electronApp = electron.app;
console.log("Local User Data: " + electronApp.getPath('userData'))
const BrowserWindow = electron.BrowserWindow;
const Tray = electron.Tray;
const nativeImage = require('electron').nativeImage
const Menu = require('electron').Menu
var appIcon = null,
jogWindow = null,
mainWindow = null
const autoUpdater = require("electron-updater").autoUpdater
autoUpdater.on('checking-for-update', () => {
var string = 'Checking for update...';
var output = {
'command': 'autoupdate',
'response': string
}
io.sockets.emit('updatedata', output);
if (jogWindow && !jogWindow.isFocused()) {
appIcon.displayBalloon({
icon: nativeImage.createFromPath(iconPath),
title: "OpenBuilds CONTROL",
content: string
})
}
})
"use strict";
exports.__esModule = true;
var electron_1 = require("electron");
var path = require("path");
var url = require("url");
var log = require("electron-log");
var electron_updater_1 = require("electron-updater");
var isDev = require("electron-is-dev");
var win, serve;
var args = process.argv.slice(1);
serve = args.some(function (val) { return val === '--serve'; });
var GITHUB_RELEASE_URL = 'https://github.com/Mokkapps/scrum-daily-standup-picker/releases';
var isLinux = process.platform === 'linux';
log.transports.file.level = 'debug';
electron_updater_1.autoUpdater.logger = log;
// Disable auto download as ASAR is disabled and therefore code signing cannot be done
electron_updater_1.autoUpdater.autoDownload = false;
log.info('App starting...');
// Manage unhandled exceptions as early as possible
process.on('uncaughtException', function (e) {
console.error("Caught unhandled exception: " + e);
log.error("Caught unhandled exception: " + e);
electron_1.dialog.showErrorBox('Caught unhandled exception', e.message || 'Unknown error message');
electron_1.app.quit();
});
function createWindow() {
var electronScreen = electron_1.screen;
var size = electronScreen.getPrimaryDisplay().workAreaSize;
// Create the browser window.
win = new electron_1.BrowserWindow({
webPreferences: {
const { app, BrowserWindow, shell, Menu, protocol, webFrame, ipcMain } = require('electron');
const autoUpdater = require('electron-updater').autoUpdater;
const url = require('url');
const path = require('path');
// const TransportNodeHid = require('@ledgerhq/hw-transport-node-hid');
app.setAsDefaultProtocolClient('xrb'); // Register handler for xrb: links
console.log(`Starting ledger@!`);
const ledger = require('./desktop-app/src/lib/ledger');
ledger.initialize();
// const Ledger = new ledger();
// Ledger.loadLedger();
const { app, dialog, shell, globalShortcut, ipcMain, BrowserWindow, Menu, Tray } = require("electron")
const path = require("path")
const url = require("url")
const autoUpdater = require("electron-updater").autoUpdater
const fs = require("fs")
const i18n = require("./lib/i18n.js")
const request = require("request")
let win, tray, menu // keep globals
const package = require("./package.json");
const configDirName = "cumulonimbus"
const configDirPath = path.join( path.parse(app.getPath("userData")).dir, configDirName )
try {
fs.mkdirSync(configDirPath)
} catch (exp) {
console.log("Looks like config dir already exists, continuing")
}
app.setPath("userData", configDirPath)
log.transports.file.file = path.join(baseWorkDir, 'mirusan_electron.log');
log.transports.file.streamConfig = { flags: 'w' };
log.transports.file.maxSize = 5 * 1024 * 1024;
log.transports.file.format = '{y}-{m}-{d} {h}:{i}:{s}:{ms} [{level}] {text}';
if (debug) {
log.transports.file.level = 'debug';
} else {
log.transports.file.level = 'warn';
}
// Electron libraries
const electron = require('electron');
const {ipcMain, dialog} = require('electron');
// Auto update
const autoUpdater = require('electron-updater').autoUpdater;
autoUpdater.logger = require('electron-log');
if (debug) {
autoUpdater.logger.transports.file.level = 'debug';
} else { autoUpdater.logger.transports.file.level = 'warn';
}
autoUpdater.checkForUpdates();
autoUpdater.on('update-downloaded', () => {
index = dialog.showMessageBox({
message: i18n.__('Software update has been downloaded.'),
detail: i18n.__('Install update and reboot?'),
buttons: [i18n.__('Reboot'), i18n.__('Later')]
});
if (index === 0) {
var isDev = require('electron-is-dev')
var electron = require('electron')
var { app, ipcMain } = electron
var Config = require('electron-store')
var get = require('lodash.get')
var xtend = require('xtend')
var userConfig = require('./config')
var menu = require('./menu')
var artwork = require('./artwork')
var GlobalShortcuts = require('./global-shortcuts')
var makeTrackDict = require('./track-dict')
var audio = require('./windows/audio')
var player = require('./windows/player')
var AudioLibrary = require('./lib/audio-library')
var ipcLogger = require('electron-ipc-log')
var autoUpdater = require('electron-updater').autoUpdater
var log = require('electron-log')
// handle uncaught exceptions before calling any functions
process.on('uncaughtException', (err) => {
log.error(err)
})
// register sentry if in production
var sentry = isDev ? null : require('../lib/sentry')
// log IPC events
ipcLogger(event => {
var { channel, data } = event
if (channel === 'timeupdate') return
log.info('✨ ipc', channel, ...data)
})
setup: function (menu) {
if (!isSupported()) {
return false;
}
autoUpdater = require("electron-updater").autoUpdater;
autoUpdater.logger = log;
autoUpdater.allowPrerelease = true;
autoUpdater.fullChangelog = true;
autoUpdater.checkForUpdates().catch(function (exc) {
// pass
});
autoUpdater.on('error', function (error, errorMessage) {
setUpdateCheckMenuEnabled(menu, true);
});
autoUpdater.on('checking-for-update', function (event) {
setUpdateCheckMenuEnabled(menu, false);
});
autoUpdater.on('update-available', function (event) {
});
public constructor({
server,
force
}: Types.ElectronUpdaterInit, Model.Project, M.Message>) {
this.server = server;
this.force = force;
this.updater = require('electron-updater').autoUpdater;
this.updater.autoDownload = false;
this.updater.autoInstallOnAppQuit = false;
this.updater.allowDowngrade = false;
this.updater.logger = {
debug: server.host.log,
error: server.host.log,
info: server.host.log,
warn: server.host.log
};
if (isDev && this.force) {
const updateConfigPath = Path.resolve(__dirname, '..', '..', '..', 'dev-app-update.yml');
this.updater.updateConfigPath = updateConfigPath;
this.server.host.log(`Dev mode, using update config from ${updateConfigPath}`);
}
const fs = require('fs')
const path = require('path')
const url = require('url')
const electron = require('electron')
const {Menu: menu, shell} = require('electron')
const ipcMain = electron.ipcMain
const dialog = electron.dialog
const app = electron.app
const BrowserWindow = electron.BrowserWindow
const autoUpdater = require('electron-updater').autoUpdater
const log = require('electron-log')
autoUpdater.logger = log
autoUpdater.logger.transports.file.level = 'info'
autoUpdater.autoDownload = false
const __DEV__ = process.env.NODE_ENV === 'development'
let windowsRegistry = []
function createWindow (opt = {})
{
let options = Object.assign(
{
width: 1600,
height: 1200,
'web-security': false,
_electron.app.on('ready', function () {
if (process.env.DEVELOPMENT) {
return;
}
_electronUpdater.aut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