Electron-builder: Target-specific extraResources ?

Created on 17 Nov 2016  Â·  5Comments  Â·  Source: electron-userland/electron-builder

  • Version: 8.6.0

  • Target: Windows and Mac


Is there a way to specify extraResources in a per-target basis?

There is some content I want to include only for windows, and there is some content I only want to include for OSX.

question

Most helpful comment

Most of the options can be specified per target or per platform. If not, option marked as Cannot be specified per target.

extraResources can be specified per platform, but not for per target — it is ok for your case: put extraResources to mac (win specific to win).

If extraResources also specified in the build it will be added to list as well.

All 5 comments

Most of the options can be specified per target or per platform. If not, option marked as Cannot be specified per target.

extraResources can be specified per platform, but not for per target — it is ok for your case: put extraResources to mac (win specific to win).

If extraResources also specified in the build it will be added to list as well.

Cool, thanks for the answer.

Just to document this more--- what I ended up doing was including this in files:

files: [ "special_plugins_${os}" ]

And then organizing the files accordingly into special_plugins_win/ and special_plugins_osx/.

Probably for plugins you should use extraFiles — it will be not packed into asar by default.

Most of the options can be specified per target or per platform. If not, option marked as Cannot be specified per target.

extraResources can be specified per platform, but not for per target — it is ok for your case: put extraResources to mac (win specific to win).

If extraResources also specified in the build it will be added to list as well.

My error:

configuration.dmg has an unknown property 'extraResources'. These properties are valid:
   object { artifactName?, background?, backgroundColor?, contents?, format?, icon?, iconSize?, iconTextSize?, internetEnabled?, publish?, sign?, title?, window?, writeUpdateInfo? }

My code:

 "extraResources": [
      {
        "from": "extra",
        "to": "externalDep/extra"
      }
    ],
 "dmg": {
      "contents": [
        {
          "x": 130,
          "y": 220
        },
        {
          "x": 410,
          "y": 220,
          "type": "link",
          "path": "/Applications"
        }
      ],
      "sign": false,
      "extraResources":[
        {
          "from": "server/macos",
          "to": "externalDep/macos"
        }
      ]
    }

What else do I need to do?

Cool, thanks for the answer.

Just to document this more--- what I ended up doing was including this in files:

files: [ "special_plugins_${os}" ]

And then organizing the files accordingly into special_plugins_win/ and special_plugins_osx/.

It works! Thank you:)

Was this page helpful?
0 / 5 - 0 ratings