aboutsummaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
authorAndrew Lee <andrew@alee14.me>2025-04-23 20:23:51 -0400
committerAndrew Lee <andrew@alee14.me>2025-04-23 20:23:51 -0400
commit983fb3ae3c832b33a7259d56d74a56a6db60e32f (patch)
treeaec64f428ae06b5d8d8aa2c2d42b6f03b6a9b320 /index.js
parent911307d3e0997d711a2e147429d34d3c2f8abf89 (diff)
downloadalaska-client-983fb3ae3c832b33a7259d56d74a56a6db60e32f.tar.gz
alaska-client-983fb3ae3c832b33a7259d56d74a56a6db60e32f.tar.bz2
alaska-client-983fb3ae3c832b33a7259d56d74a56a6db60e32f.zip
Client works with electron-builderHEADv1.0.0master
Diffstat (limited to 'index.js')
-rw-r--r--index.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/index.js b/index.js
index 37e0691..69af246 100644
--- a/index.js
+++ b/index.js
@@ -11,16 +11,24 @@ autoUpdater.logger = log;
autoUpdater.logger.transports.file.level = 'info';
const pluginPaths = {
- win32: path.join(__dirname, 'plugin/pepflashplayer.dll'),
- darwin: path.join(__dirname, 'plugin/PepperFlashPlayer.plugin'),
- linux: path.join(__dirname, 'plugin/libpepflashplayer.so')
-}
+ win32: path.join(app.getAppPath(), 'plugin/pepflashplayer.dll'),
+ darwin: path.join(app.getAppPath(), 'plugin/PepperFlashPlayer.plugin'),
+ linux: path.join(app.getAppPath(), 'plugin/libpepflashplayer.so')
+};
const pluginName = pluginPaths[process.platform];
if (process.platform === 'linux') app.commandLine.appendSwitch('--no-sandbox');
app.commandLine.appendSwitch('ignore-certificate-errors');
-app.commandLine.appendSwitch('ppapi-flash-path', pluginName);
+
+if (process.mainModule.filename.includes('app.asar')) {
+ const unpackedPath = pluginName.replace('app.asar', 'app.asar.unpacked');
+ console.log(`Adjusted plugin path for asar: ${unpackedPath}`);
+ app.commandLine.appendSwitch('ppapi-flash-path', unpackedPath);
+} else {
+ app.commandLine.appendSwitch('ppapi-flash-path', pluginName);
+}
+
app.commandLine.appendSwitch('ppapi-flash-version', '31.0.0.122');
app.on('window-all-closed', () => {