Skip to content

Commit 2910833

Browse files
committed
Corrected paths
1 parent 42e816e commit 2910833

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/ElectronNET.Host/src/main.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,14 @@ const manifestJsonFileName = app.commandLine.hasSwitch("manifest")
4343
: "electron.manifest.json";
4444

4545
const watchable = app.commandLine.hasSwitch("watch");
46+
const isAsar = __dirname.includes("app.asar");
4647

4748
// if watch is enabled lets change the path
4849
const currentBinPath = watchable
49-
? resolve(__dirname, "../../")
50-
: resolve(__dirname, "../../", "bin");
50+
? resolve(__dirname, "../../..")
51+
: isAsar
52+
? resolve(__dirname, "../../bin")
53+
: resolve(__dirname, "../bin");
5154

5255
const hostHookScriptFilePath = resolve(__dirname, "host-hook.js");
5356
const manifestJsonFilePath = resolve(currentBinPath, manifestJsonFileName);
@@ -160,9 +163,11 @@ function isSplashScreenEnabled() {
160163
}
161164

162165
function 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

Comments
 (0)