Skip to content

Commit b029cfa

Browse files
Fix maximize button failing
1 parent f6f1989 commit b029cfa

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
},
5151
"extraResources": [
5252
"./plugins/**",
53-
"./src/local/**"
53+
"./src/local/**",
54+
"./src/renderer/preload.js"
5455
]
5556
}
5657
}

src/main/index.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@ if (process.platform == "win32") {
1818
}
1919
let win;
2020
let 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+
}
2731
switch (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;
4449
if(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
}
4954
if (process.platform === "linux") app.commandLine.appendSwitch("no-sandbox");
5055
app.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

Comments
 (0)