@@ -55,9 +55,9 @@ require("./main_httpController.js")();
5555require ( "./main_grpcController.js" ) ( ) ;
5656
5757// configure logging
58- // autoUpdater.logger = log;
59- // autoUpdater.logger.transports.file.level = "info";
60- // log.info("App starting...");
58+ autoUpdater . logger = log ;
59+ autoUpdater . logger . transports . file . level = "info" ;
60+ log . info ( "App starting..." ) ;
6161
6262let mainWindow ;
6363
@@ -170,26 +170,6 @@ isDev
170170================================
171171 ` ) ;
172172
173- // let isDev = false;
174- // console.log("process.defaultApp ->", process.defaultApp);
175- // console.log("process.execPath -> ", process.execPath);
176-
177- // if (
178- // process.defaultApp ||
179- // /[\\/]electron-prebuilt[\\/]/.test(process.execPath) ||
180- // /[\\/]electron[\\/]/.test(process.execPath)
181- // ) {
182- // isDev = true;
183- // }
184- // console.log(
185- // "current regex test -> ",
186- // /[\\/]electron-prebuilt[\\/]/.test(process.execPath)
187- // );
188- // if (isDev) console.log("isDev is TRUE");
189- // if (isDev === false) console.log("isDev is FALSE");
190- // Temporary fix broken high-dpi scale factor on Windows (125% scaling)
191- // info: https://github.com/electron/electron/issues/9691
192-
193173if ( process . platform === "win32" ) {
194174 // if user is on windows...
195175 app . commandLine . appendSwitch ( "high-dpi-support" , "true" ) ;
@@ -278,8 +258,6 @@ function createWindow() {
278258 // tldr: Remove the BrowserWindow instance that we created earlier by setting its value to null when we exit Swell
279259 mainWindow = null ;
280260 } ) ;
281-
282- // moved require mainmenu to top
283261}
284262
285263/********* end of createWindow declaration ******/
@@ -327,38 +305,38 @@ const sendStatusToWindow = (text) => {
327305 }
328306} ;
329307
330- // ipcMain.on("check-for-update", () => {
331- // //listens to ipcRenderer in UpdatePopUpContainer.jsx
332- // if (!isDev) autoUpdater.checkForUpdates();
333- // });
334- // autoUpdater.on(' checking-for-update' , () => {
335- // sendStatusToWindow(' Checking for update...' );
336- // / / });
337- // autoUpdater.on(' update-available', info => {
338- // sendStatusToWindow(' Update available.' );
339- // });
340- // autoUpdater.on(' update-not-available', info => {
341- // sendStatusToWindow(' Update not available.' );
342- // });
343- // autoUpdater.on("error", (err) => {
344- // console.error("autoUpdater error -> ", err);
345- // sendStatusToWindow(`Error in auto-updater`);
346- // });
347- // autoUpdater.on("download-progress", (progressObj) => {
348- // sendStatusToWindow(
349- // `Download speed: ${progressObj.bytesPerSecond} - Downloaded ${progressObj.percent}% (${progressObj.transferred} + '/' + ${progressObj.total} + )`
350- // );
351- // });
352- // autoUpdater.on("update-downloaded", (info) => {
353- // sendStatusToWindow("Update downloaded.");
354- // });
355-
356- // autoUpdater.on(' update-downloaded', info => {
357- // // Wait 5 seconds, then quit and install
358- // // In your application, you don't need to wait 500 ms.
359- // // You could call autoUpdater.quitAndInstall(); immediately
360- // autoUpdater.quitAndInstall();
361- // });
308+ ipcMain . on ( "check-for-update" , ( ) => {
309+ //listens to ipcRenderer in UpdatePopUpContainer.jsx
310+ if ( ! isDev ) autoUpdater . checkForUpdates ( ) ;
311+ } ) ;
312+ autoUpdater . on ( " checking-for-update" , ( ) => {
313+ sendStatusToWindow ( " Checking for update..." ) ;
314+ } ) ;
315+ autoUpdater . on ( " update-available" , ( info ) => {
316+ sendStatusToWindow ( " Update available." ) ;
317+ } ) ;
318+ autoUpdater . on ( " update-not-available" , ( info ) => {
319+ sendStatusToWindow ( " Update not available." ) ;
320+ } ) ;
321+ autoUpdater . on ( "error" , ( err ) => {
322+ console . error ( "autoUpdater error -> " , err ) ;
323+ sendStatusToWindow ( `Error in auto-updater` ) ;
324+ } ) ;
325+ autoUpdater . on ( "download-progress" , ( progressObj ) => {
326+ sendStatusToWindow (
327+ `Download speed: ${ progressObj . bytesPerSecond } - Downloaded ${ progressObj . percent } % (${ progressObj . transferred } + '/' + ${ progressObj . total } + )`
328+ ) ;
329+ } ) ;
330+ autoUpdater . on ( "update-downloaded" , ( info ) => {
331+ sendStatusToWindow ( "Update downloaded." ) ;
332+ } ) ;
333+
334+ autoUpdater . on ( " update-downloaded" , ( info ) => {
335+ // Wait 5 seconds, then quit and install
336+ // In your application, you don't need to wait 500 ms.
337+ // You could call autoUpdater.quitAndInstall(); immediately
338+ autoUpdater . quitAndInstall ( ) ;
339+ } ) ;
362340ipcMain . on ( "quit-and-install" , ( ) => {
363341 autoUpdater . quitAndInstall ( ) ;
364342} ) ;
0 commit comments