mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-11 18:19:58 +00:00
Add support for building as 32-bit on Windows
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
const { __applicationName
|
||||
@@ -9,35 +11,65 @@ const rootPath = path.join(__dirname, "../../../");
|
||||
|
||||
exports.DIST_PATH = path.join(rootPath, "dist/app");
|
||||
exports.LICENSE_PATH = path.join(rootPath, "LICENSE");
|
||||
exports.WIN_REGISTRY_KEY = __applicationName;
|
||||
|
||||
exports.executableName = {
|
||||
win32: `${__applicationExecutableName}.exe`
|
||||
, darwin: __applicationExecutableName
|
||||
, linux: __applicationExecutableName
|
||||
};
|
||||
exports.REGISTRY_KEY = __applicationName;
|
||||
|
||||
exports.executablePath = {
|
||||
win32: `C:\\Program Files\\${__applicationDirectoryName}\\`
|
||||
, darwin: `/Library/Application Support/${__applicationDirectoryName}/`
|
||||
, linux: `/opt/${__applicationDirectoryName}/`
|
||||
};
|
||||
|
||||
exports.manifestName = `${__applicationName}.json`;
|
||||
|
||||
exports.manifestPath = {
|
||||
win32: `C:\\Program Files\\${__applicationDirectoryName}\\`
|
||||
, darwin: "/Library/Application Support/Mozilla/NativeMessagingHosts/"
|
||||
, linux: {
|
||||
deb: "/usr/lib/mozilla/native-messaging-hosts/"
|
||||
, rpm: "/usr/lib64/mozilla/native-messaging-hosts/"
|
||||
}
|
||||
};
|
||||
|
||||
exports.selectorExecutableName = "fx_cast_selector.app";
|
||||
|
||||
exports.pkgPlatform = {
|
||||
exports.pkgPlatformMap = {
|
||||
win32: "win"
|
||||
, darwin: "macos"
|
||||
, linux: "linux"
|
||||
};
|
||||
|
||||
exports.MANIFEST_NAME = `${__applicationName}.json`;
|
||||
exports.SELECTOR_EXECUTABLE_NAME = "fx_cast_selector.app";
|
||||
|
||||
exports.getExecutableName = platform => {
|
||||
switch (platform) {
|
||||
case "win32":
|
||||
return `${__applicationExecutableName}.exe`;
|
||||
case "darwin":
|
||||
case "linux":
|
||||
return __applicationExecutableName;
|
||||
}
|
||||
}
|
||||
|
||||
exports.getExecutablePath = (platform, arch) => {
|
||||
const EXECUTABLE_PATH_WIN32_X64 = `C:\\Program Files\\${__applicationDirectoryName}\\`;
|
||||
const EXECUTABLE_PATH_WIN32_X86 = `C:\\Program Files (x86)\\${__applicationDirectoryName}\\`;
|
||||
const EXECUTABLE_PATH_DARWIN = `/Library/Application Support/${__applicationDirectoryName}/`;
|
||||
const EXECUTABLE_PATH_LINUX = `/opt/${__applicationDirectoryName}/`;
|
||||
|
||||
switch (platform) {
|
||||
case "win32":
|
||||
switch (arch) {
|
||||
case "x86": return EXECUTABLE_PATH_WIN32_X86;
|
||||
case "x64": return EXECUTABLE_PATH_WIN32_X64;
|
||||
}
|
||||
break;
|
||||
case "darwin": return EXECUTABLE_PATH_DARWIN;
|
||||
case "linux": return EXECUTABLE_PATH_LINUX;
|
||||
}
|
||||
};
|
||||
|
||||
exports.getManifestPath = (platform, arch, linuxPackageType) => {
|
||||
const MANIFEST_PATH_DARWIN = "/Library/Application Support/Mozilla/NativeMessagingHosts/";
|
||||
const MANIFEST_PATH_LINUX_DEB = "/usr/lib/mozilla/native-messaging-hosts/";
|
||||
const MANIFEST_PATH_LINUX_RPM ="/usr/lib64/mozilla/native-messaging-hosts/";
|
||||
|
||||
switch (platform) {
|
||||
case "win32":
|
||||
switch (arch) {
|
||||
case "x86":
|
||||
case "x64": return exports.getExecutablePath(platform, arch);
|
||||
}
|
||||
break;
|
||||
case "darwin": return MANIFEST_PATH_DARWIN;
|
||||
case "linux":
|
||||
switch (linuxPackageType) {
|
||||
case "deb": return MANIFEST_PATH_LINUX_DEB;
|
||||
case "rpm": return MANIFEST_PATH_LINUX_RPM;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user