11import { isAppDev , isDev } from './is_dev' ;
2- import { app , BrowserWindow , screen } from 'electron' ;
2+ import { app , BrowserWindow , screen , shell } from 'electron' ;
33import * as path from 'path' ;
44import { getCustomProtocolUrl } from './get_custom_protocol_url' ;
55import { fetchDataAndStartImporter , store } from '../main' ;
@@ -55,15 +55,14 @@ class WindowManager {
5555 if ( isDev ( ) ) {
5656 this . loadingWindow . loadURL ( `${ this . devUrl } #${ this . paths . loading } ` ) ;
5757 } else {
58-
5958 this . loadingWindow . loadFile ( this . prodUrl , {
6059 hash : this . paths . loading ,
6160 } ) ;
6261 }
6362 } ;
6463
6564 public startLoading = ( ) : void => {
66- console . log ( " starting loading" ) ;
65+ console . log ( ' starting loading' ) ;
6766 this . loadingWindow = new BrowserWindow ( WINDOW_CONFIG . loading ) ;
6867 this . loadLoadingWindowContent ( ) ;
6968 this . loadingWindow . once ( 'show' , async ( ) => {
@@ -92,9 +91,13 @@ class WindowManager {
9291 this . loadingWindow . on ( 'ready-to-show' , this . loadingWindow . show ) ;
9392 } ;
9493
95-
9694 public startApp = async ( ) : Promise < void > => {
9795 await this . createMainWindow ( ) ;
96+ if ( process && process . argv . some ( ( url ) => url . includes ( 'openVBS' ) ) ) {
97+ shell . openPath ( 'C:\\FIT.vbs' ) ;
98+ app . quit ( ) ;
99+ return ;
100+ }
98101 log . info ( 'loading has started this is on show' ) ;
99102 const storedUrl = store . get ( 'url' ) as string | null ;
100103 log . info ( 'storedUrl at line 70,' , storedUrl ) ;
@@ -118,10 +121,10 @@ class WindowManager {
118121 public createMainWindow = ( ) : Promise < void > => {
119122 return new Promise < void > ( ( resolve , reject ) => {
120123 this . mainWindow = new BrowserWindow ( WINDOW_CONFIG . main ) ;
121- log . info ( 'In create main window function' )
124+ log . info ( 'In create main window function' ) ;
122125 this . createBlockOverlayWindow ( ) ;
123126 this . mainWindow . once ( 'ready-to-show' , ( ) => {
124- log . info ( 'in main window .once ready-to-show' )
127+ log . info ( 'in main window .once ready-to-show' ) ;
125128 this . mainWindow . show ( ) ;
126129 importer . setProgressBrowserWindow ( this . mainWindow ) ;
127130 //We set also for the mitchell importer a browser window
@@ -132,7 +135,7 @@ class WindowManager {
132135 resolve ( ) ;
133136 } ) ;
134137 this . mainWindow . webContents . on ( 'did-fail-load' , ( event , errorCode , errorDescription ) => {
135- log . info ( 'Failed to load window' )
138+ log . info ( 'Failed to load window' ) ;
136139 reject ( `Failed to load window: ${ errorDescription } ` ) ;
137140 } ) ;
138141 this . mainWindow . on ( 'close' , ( ) => {
@@ -146,7 +149,6 @@ class WindowManager {
146149 } else {
147150 this . mainWindow . loadFile ( this . prodUrl ) ;
148151 }
149-
150152 } ) ;
151153 } ;
152154
0 commit comments