63 lines
2.1 KiB
JavaScript
63 lines
2.1 KiB
JavaScript
import { readFileSync } from "node:fs";
|
|
import path from "node:path";
|
|
import os from "node:os";
|
|
import process from "node:process";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const root = path.dirname(fileURLToPath(import.meta.url));
|
|
const packageJson = JSON.parse(readFileSync(path.join(root, "package.json"), "utf8"));
|
|
|
|
/** @type {import('electron-builder').Configuration} */
|
|
export default {
|
|
appId: "com.rpastudio.desktop",
|
|
productName: "RPA Studio",
|
|
artifactName: "RPA-Studio-Setup-${version}-win-${arch}.${ext}",
|
|
directories: {
|
|
output: path.join(os.tmpdir(), "RPA-Studio-electron-builder"),
|
|
buildResources: path.join(root, "build")
|
|
},
|
|
files: [
|
|
"out/**/*",
|
|
"package.json"
|
|
],
|
|
extraResources: [
|
|
{ from: path.join(root, "resources", "catalog.json"), to: "catalog.json" },
|
|
{ from: path.join(root, "resources", "excluded.json"), to: "excluded.json" },
|
|
{ from: path.join(root, "resources", "capability-duplicates.json"), to: "capability-duplicates.json" },
|
|
{ from: path.join(root, "resources", "desktop-picker.ps1"), to: "desktop-picker.ps1" },
|
|
{ from: path.join(root, "resources", "models"), to: "models" },
|
|
{ from: path.join(root, "resources", "fixture"), to: "fixture" }
|
|
],
|
|
asar: true,
|
|
asarUnpack: [
|
|
"node_modules/onnxruntime-node/**",
|
|
"node_modules/sharp/**",
|
|
"node_modules/@gutenye/**",
|
|
"node_modules/@napi-rs/**"
|
|
],
|
|
compression: "maximum",
|
|
npmRebuild: false,
|
|
electronVersion: packageJson.devDependencies.electron,
|
|
electronDist: path.join(root, "node_modules", "electron", "dist"),
|
|
win: {
|
|
target: [{ target: "nsis", arch: ["x64"] }],
|
|
icon: path.join(root, "build", "icon.ico"),
|
|
signAndEditExecutable: true
|
|
},
|
|
nsis: {
|
|
oneClick: false,
|
|
perMachine: false,
|
|
allowElevation: false,
|
|
allowToChangeInstallationDirectory: true,
|
|
installerLanguages: ["zh_CN"],
|
|
language: "2052",
|
|
shortcutName: "RPA Studio",
|
|
uninstallDisplayName: "RPA Studio ${version}",
|
|
createDesktopShortcut: true,
|
|
createStartMenuShortcut: true,
|
|
runAfterFinish: true,
|
|
deleteAppDataOnUninstall: false
|
|
},
|
|
publish: null
|
|
};
|