1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-12-01 02:27:16 +01:00
upscayl/main/binaries.js

26 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-11-11 21:41:28 +01:00
"use strict";
/*
appRootDir is the resources directory inside the unpacked electron app temp directory.
resources contains app.asar file, that contains the main and renderer files.
We're putting resources/{os}/bin from project inside resources/bin of electron. Same for the models directory as well.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.modelsPath = exports.execPath = void 0;
const path_1 = require("path");
2022-11-11 21:50:20 +01:00
const getPlatform_1 = __importDefault(require("./getPlatform"));
2022-11-11 21:41:28 +01:00
const electron_is_dev_1 = __importDefault(require("electron-is-dev"));
const electron_1 = require("electron");
const appRootDir = electron_1.app.getAppPath();
const binariesPath = electron_is_dev_1.default
2022-11-11 21:50:20 +01:00
? (0, path_1.join)(appRootDir, "resources", (0, getPlatform_1.default)(), "bin")
2022-11-11 21:41:28 +01:00
: (0, path_1.join)((0, path_1.dirname)(appRootDir), "bin");
const execPath = (execName) => (0, path_1.resolve)((0, path_1.join)(binariesPath, `./upscayl-${execName}`));
exports.execPath = execPath;
const modelsPath = electron_is_dev_1.default
? (0, path_1.resolve)((0, path_1.join)(appRootDir, "resources", "models"))
: (0, path_1.resolve)((0, path_1.join)((0, path_1.dirname)(appRootDir), "models"));
exports.modelsPath = modelsPath;