最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Using electron-builder, how to include a dynlib on Linux? - Stack Overflow

programmeradmin6浏览0评论

I build my application with Electron-builder. On Linux I need to ship a .so file used by the .node library, but the file is nowhere inside the app.asar file. On Windows I do the same for a .dll file and it works perfectly. Here is my `electron-builder.yaml file:

---
"$schema": .json
appId: com.electron.{productName}
productName: STMng
copyright: Copyright © 2025 ${author}
asar: true
directories:
  output: release/${version}
  buildResources: resources
files:
  - dist-electron
  - dist
  - build/Release/native.node
  - "!**/node_modules/**/*.d.ts.map"
  - "!**/node_modules/**/*.flow"
  - "!**/node_modules/**/tsconfig.tsbuildinfo"
  - "!**/node_modules/**/{test,__tests__,tests,powered-test,example,examples}"
asarUnpack:
  - dist/bin/ffmpeg.exe
  - dist/bin/ffmpeg
  - dist/doc/**/*.*
electronLanguages:
  - en-US
linux:
  icon: resources/icon.png
  category: Visualization
  target:
  - AppImage
  extraFiles:
    - from: build/Release/libsymspg.so.2.3.2
      to: dist/libsymspg.so.2
mac:
  artifactName: "${productName}_${version}.${ext}"
  target:
  - dmg
win:
  target:
  - target: nsis
    arch:
    - x64
  artifactName: ${productName}-${version}-setup.${ext}
  extraFiles:
    - from: build/Release/symspg.dll
      to: .
nsis:
  oneClick: false
  perMachine: true
  selectPerMachineByDefault: true
  allowToChangeInstallationDirectory: true
  deleteAppDataOnUninstall: false
  shortcutName: ${productName}
  uninstallDisplayName: ${productName}
  createDesktopShortcut: always

What I'm missing? Thanks!

发布评论

评论列表(0)

  1. 暂无评论