Fix IPC proxy selection in prod when using ELECTRON_IS_DEV (#11412)
This commit is contained in:
parent
bdf91e24c6
commit
e1d46045e0
|
@ -331,7 +331,7 @@ export class NativeMessagingMain {
|
||||||
const ext = process.platform === "win32" ? ".exe" : "";
|
const ext = process.platform === "win32" ? ".exe" : "";
|
||||||
|
|
||||||
if (isDev()) {
|
if (isDev()) {
|
||||||
return path.join(
|
const devPath = path.join(
|
||||||
this.appPath,
|
this.appPath,
|
||||||
"..",
|
"..",
|
||||||
"desktop_native",
|
"desktop_native",
|
||||||
|
@ -339,6 +339,12 @@ export class NativeMessagingMain {
|
||||||
"debug",
|
"debug",
|
||||||
`desktop_proxy${ext}`,
|
`desktop_proxy${ext}`,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// isDev() returns true when using a production build with ELECTRON_IS_DEV=1,
|
||||||
|
// so we need to fall back to the prod binary if the dev binary doesn't exist.
|
||||||
|
if (existsSync(devPath)) {
|
||||||
|
return devPath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return path.join(path.dirname(this.exePath), `desktop_proxy${ext}`);
|
return path.join(path.dirname(this.exePath), `desktop_proxy${ext}`);
|
||||||
|
|
Loading…
Reference in New Issue