- webpage-element.onnx 为实测首选模型,运行时永远先命中; ui-icon-detect/model.onnx 仅作为老安装包兜底回退,无实际使用场景 - 删除模型目录(含无引用的 preprocessor_config.json),运行时去掉兜底候选 - 上一个提交给打包加的 ui-icon-detect 拷贝行随之移除 - 注:git 历史中该 blob 仍存在(不做历史改写),仅工作区与新 clone 不再需要下载该模型
66 lines
2.3 KiB
JavaScript
66 lines
2.3 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",
|
||
// ws 已从主进程 bundle 外部化(运行时 require),必须随包发布;
|
||
// ws 为零依赖纯 JS 库,asar 内即可解析
|
||
"node_modules/ws/**/*"
|
||
],
|
||
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", "ui-element-detect"), to: "models/ui-element-detect" },
|
||
{ 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
|
||
};
|