electron-userland/electron-builder

How to add dlls to application package

d9k opened this issue · 8 comments

d9k commented

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).

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?

d9k commented

@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 #39 (comment)

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

d9k commented

@develar, yes, it works as expected, thanks a lot! 😌
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.