Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
if(app.isPackaged) {
logger.info('Starting updater...');
require('./updater.js');
template.splice(template.length - 2, 1);
} else {
logger.info('Opening dev tools...');
mainWindow.webContents.openDevTools();
}
menu = electron.Menu.buildFromTemplate(template);
electron.Menu.setApplicationMenu(menu);
tray = new CATray(mainWindow, tt);
const path = require('path');
if('function' === typeof flac.bindings.load) {
logger.info('Loading libFLAC from resources');
if(process.platform === 'darwin') {
flac.bindings.load(__dirname + '/../lib/mac/libFLAC.dylib');
} else if(process.platform === 'linux') {
flac.bindings.load(__dirname + '/../lib/linux/libFLAC.so');
} else if(process.platform === 'windows' || process.platform === 'win32') {
flac.bindings.load(path.dirname(__dirname) + '\\lib\\win\\libFLAC');
}
}
if(!c.AudioInput.isNativeLibraryLoaded()) {
logger.info('Loading libportaudio from resources');
if(process.platform === 'darwin') {
c.AudioInput.loadNativeLibrary(__dirname + '/../lib/mac/libportaudio.dylib');
} else if(process.platform === 'linux') {
c.AudioInput.loadNativeLibrary(__dirname + '/../lib/linux/libportaudio.so');
mainWindow.webContents.openDevTools();
}
menu = electron.Menu.buildFromTemplate(template);
electron.Menu.setApplicationMenu(menu);
tray = new CATray(mainWindow, tt);
const path = require('path');
if('function' === typeof flac.bindings.load) {
logger.info('Loading libFLAC from resources');
if(process.platform === 'darwin') {
flac.bindings.load(__dirname + '/../lib/mac/libFLAC.dylib');
} else if(process.platform === 'linux') {
flac.bindings.load(__dirname + '/../lib/linux/libFLAC.so');
} else if(process.platform === 'windows' || process.platform === 'win32') {
flac.bindings.load(path.dirname(__dirname) + '\\lib\\win\\libFLAC');
}
}
if(!c.AudioInput.isNativeLibraryLoaded()) {
logger.info('Loading libportaudio from resources');
if(process.platform === 'darwin') {
c.AudioInput.loadNativeLibrary(__dirname + '/../lib/mac/libportaudio.dylib');
} else if(process.platform === 'linux') {
c.AudioInput.loadNativeLibrary(__dirname + '/../lib/linux/libportaudio.so');
} else if(process.platform === 'windows' || process.platform === 'win32') {
c.AudioInput.loadNativeLibrary(path.dirname(__dirname)+'\\lib\\win\\portaudio_x64');
}
}
electron.ipcMain.once('windowLoaded', () => {
config.get('showWindow').then(value => value && mainWindow.show());