94 lines
2.1 KiB
JavaScript
94 lines
2.1 KiB
JavaScript
const path = require("node:path");
|
|
const { version } = require("./package.json");
|
|
const brand = require("../../product.json");
|
|
const pandocRuntime = require(
|
|
"../../packages/docx-engine/src/pandoc-runtime.json"
|
|
);
|
|
|
|
const windowsIcon = path.resolve(
|
|
__dirname,
|
|
"../../logos/desktop/windows/app.ico"
|
|
);
|
|
const nsisInclude = process.env.MD_TO_PDF_NSIS_INCLUDE?.trim() ||
|
|
"build/installer.nsh";
|
|
|
|
module.exports = {
|
|
appId: brand.appId,
|
|
productName: brand.englishName,
|
|
copyright: "Copyright © YIXIONG Tech.ltd",
|
|
asar: true,
|
|
electronLanguages: ["zh-CN", "en-US"],
|
|
directories: {
|
|
output: `out/v${version}`
|
|
},
|
|
files: [
|
|
"dist/**/*",
|
|
"package.json"
|
|
],
|
|
extraResources: [
|
|
{
|
|
from: "../web/dist",
|
|
to: "dist",
|
|
filter: ["**/*"]
|
|
},
|
|
{
|
|
from: "../../themes",
|
|
to: "themes",
|
|
filter: ["**/*"]
|
|
},
|
|
{
|
|
from: "../../samples",
|
|
to: "samples",
|
|
filter: ["**/*"]
|
|
},
|
|
{
|
|
from: `.runtime/pandoc/${pandocRuntime.version}/windows-x86_64`,
|
|
to: `pandoc/${pandocRuntime.version}/windows-x86_64`,
|
|
filter: [
|
|
"pandoc.exe",
|
|
"COPYING.rtf",
|
|
"COPYRIGHT.txt",
|
|
"runtime-manifest.json"
|
|
]
|
|
},
|
|
{
|
|
from: windowsIcon,
|
|
to: "app.ico"
|
|
},
|
|
{
|
|
from: "../../logos/desktop/macos/app.icns",
|
|
to: "app.icns"
|
|
}
|
|
],
|
|
win: {
|
|
target: [
|
|
{
|
|
target: "nsis",
|
|
arch: ["x64"]
|
|
},
|
|
{
|
|
target: "zip",
|
|
arch: ["x64"]
|
|
}
|
|
],
|
|
icon: windowsIcon,
|
|
executableName: brand.executableName,
|
|
artifactName: `${brand.artifactPrefix}-${version}-x86_64.\${ext}`
|
|
},
|
|
nsis: {
|
|
oneClick: false,
|
|
allowToChangeInstallationDirectory: true,
|
|
perMachine: false,
|
|
allowElevation: true,
|
|
createDesktopShortcut: false,
|
|
createStartMenuShortcut: false,
|
|
shortcutName: brand.displayName,
|
|
uninstallDisplayName: brand.displayName,
|
|
installerIcon: windowsIcon,
|
|
uninstallerIcon: windowsIcon,
|
|
installerLanguages: ["zh_CN"],
|
|
include: nsisInclude,
|
|
artifactName: `${brand.artifactPrefix}-${version}-x86_64-Setup.\${ext}`
|
|
}
|
|
};
|