@@ -18,12 +18,16 @@ if (process.platform == "win32") {
1818}
1919let win ;
2020let pluginName ;
21- const isDev = ! app . isPackaged ; // Change to false if you want to disable development mode and package the application.
21+ const isDev = ! app . isPackaged ;
2222
23- // Define paths
24- const rendererPath = path . resolve ( path . join ( __dirname , '../renderer' ) ) ;
25- const preloadPath = path . resolve ( path . join ( rendererPath , 'preload.js' ) ) ;
26- const localPath = path . resolve ( path . join ( __dirname , '../local' ) ) ;
23+ let rendererPath , preloadPath ;
24+ if ( isDev ) {
25+ rendererPath = path . resolve ( path . join ( __dirname , '../renderer' ) ) ;
26+ preloadPath = path . resolve ( path . join ( rendererPath , 'preload.js' ) ) ;
27+ } else {
28+ rendererPath = path . join ( path . dirname ( app . getAppPath ( ) ) , 'src' , 'renderer' ) ;
29+ preloadPath = path . join ( rendererPath , 'preload.js' ) ;
30+ }
2731switch ( process . platform ) {
2832 case "win32" :
2933 pluginName = process . arch == 'x64' ? 'x64/pepflashplayer.dll' : 'x32/pepflashplayer32.dll' ;
@@ -41,10 +45,11 @@ switch (process.platform) {
4145 break ;
4246}
4347
48+ let flashpath ;
4449if ( isDev ) {
45- flashpath = path . join ( "../../../plugins/" , pluginName )
50+ flashpath = path . join ( "../../../plugins/" , pluginName ) ;
4651} else {
47- flashpath = path . join ( __dirname + "/../ plugins/" , pluginName )
52+ flashpath = path . join ( path . dirname ( app . getAppPath ( ) ) , ' plugins' , pluginName ) ;
4853}
4954if ( process . platform === "linux" ) app . commandLine . appendSwitch ( "no-sandbox" ) ;
5055app . commandLine . appendSwitch ( "ppapi-flash-path" , flashpath ) ;
@@ -140,8 +145,8 @@ function createWindow() {
140145 if ( isDev ) {
141146 startHtmlPath = path . resolve ( path . join ( __dirname , '..' , 'local' , 'start.html' ) ) ;
142147 } else {
143- startHtmlPath = path . resolve ( path . join ( app . getAppPath ( ) , 'resources' , ' src', 'local' , 'start.html' ) ) ;
144- }
148+ startHtmlPath = path . join ( path . dirname ( app . getAppPath ( ) ) , 'src' , 'local' , 'start.html' ) ;
149+ }
145150
146151 // Load the URL with proper file protocol and use the config for the initial URL
147152 const startUrl = `${ pathToFileURL ( startHtmlPath ) } ?url=${ config . getUrl ( 'update' ) } ` ;
0 commit comments