Electron-builder: How to add dlls to application package

Created on 11 Mar 2016  Â·  8Comments  Â·  Source: electron-userland/electron-builder

Hi! Maybe I've missed something... How can I add dll libraries to application installation package? The dlls must be at the same (package's root) folder where MyApp.exe located (node.dll and others).

feature

Most helpful comment

Do there exist any working solution exists for now?

No. But once will be a proposal, it will be implemented. Since today is Friday, you can expect working solution on Monday.

I like your proposal.

All 8 comments

I don't see such option in the electron-packager.

What solution do yo like — extraResources dir in the build directory (and configurable path to change default)?

Or just specify extraResources to filenames of a files to be copies?
Maybe there is another solution to magically find such dlls and copy it?

@develar thanks for answering!
Are you just planning this feature?
Do there exist any working solution for adding extra resources, maybe a hack?

If you ask me, I love gulp's style of pattern matching. Files and folders can be specified. ! symbol at the beginning of rule means exclusion. extraResources may be different for each platform. For example:

"build": {
    //...
    "extraResources":  [
    //    "common"
    ],
    "win": {
         // ...
         "extraResources":  [
              "./*.dll",
              "!./exclude-me.dll"
         ],
    },
    "osx": {
         // ...
         "extraResources":  [
              // osx-specific
         ],
    },
}

Do there exist any working solution exists for now?

No. But once will be a proposal, it will be implemented. Since today is Friday, you can expect working solution on Monday.

I like your proposal.

electron-packager currently has option extra-resource but only for OS X.

Doc draft note:

  • glob is used.
  • You can use ${os} (expanded to osx, linux, win according to current platform) and ${arch} in the pattern.
  • If directory matched, all content is copied. So, you can just specify foo to copy <project_dir>/foo to app.

And, obviously, you should use two-package.json layout, because otherwise electron-packager will copy all project dir contents to app. See #182 and https://github.com/loopline-systems/electron-builder/issues/39#issuecomment-188855084

v2.10.0 is a pre-release version, once you confirm that it works as expected, it will be tagged as latest.

@develar, yes, it works as expected, thanks a lot! :relieved:
It would be nice to have more extensive documentation about all options in future. And it's a little bit unclear how to separate build options between two package.json files.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JohnWeisz picture JohnWeisz  Â·  3Comments

ccorcos picture ccorcos  Â·  3Comments

jhg picture jhg  Â·  3Comments

antonycourtney picture antonycourtney  Â·  3Comments

omarkilani picture omarkilani  Â·  3Comments