@@ -43,11 +43,14 @@ const manifestJsonFileName = app.commandLine.hasSwitch("manifest")
4343  : "electron.manifest.json" ; 
4444
4545const  watchable  =  app . commandLine . hasSwitch ( "watch" ) ; 
46+ const  isAsar  =  __dirname . includes ( "app.asar" ) ; 
4647
4748// if watch is enabled lets change the path 
4849const  currentBinPath  =  watchable 
49-   ? resolve ( __dirname ,  "../../" ) 
50-   : resolve ( __dirname ,  "../../" ,  "bin" ) ; 
50+   ? resolve ( __dirname ,  "../../.." ) 
51+   : isAsar 
52+   ? resolve ( __dirname ,  "../../bin" ) 
53+   : resolve ( __dirname ,  "../bin" ) ; 
5154
5255const  hostHookScriptFilePath  =  resolve ( __dirname ,  "host-hook.js" ) ; 
5356const  manifestJsonFilePath  =  resolve ( currentBinPath ,  manifestJsonFileName ) ; 
@@ -160,9 +163,11 @@ function isSplashScreenEnabled() {
160163} 
161164
162165function  startSplashScreen ( )  { 
166+   const  file  =  manifestJsonFile . splashscreen . imageFile ; 
167+ 
163168  const  imageFile  =  resolve ( 
164169    currentBinPath , 
165-     manifestJsonFile . splashscreen . imageFile 
170+     file . startsWith ( "/" )  ?  file . substring ( 1 )  :  file 
166171  ) ; 
167172
168173  imageSize ( imageFile ,  ( error ,  dimensions )  =>  { 
@@ -192,7 +197,7 @@ function startSplashScreen() {
192197    } ) ; 
193198
194199    const  loadSplashscreenUrl  = 
195-       resolve ( __dirname ,  "splashscreen" ,  "index.html" )  + 
200+       resolve ( __dirname ,  ".."  ,   " splashscreen",  "index.html" )  + 
196201      "?imgPath="  + 
197202      imageFile ; 
198203
0 commit comments