Electron-builder: Cannot use afterInstall to run tpl scripts anymore inside linux target build

Created on 4 Sep 2017  路  2Comments  路  Source: electron-userland/electron-builder


  • Version:
    19.27.3

  • Target:
    linux

    afterInstall option inside package.json build section does not work anymore (it was working a few weeks ago)
"build": {
    "appId": "com.codemotionkids.mbotjr",
    "linux": {
      "target": "deb",
      "afterInstall": "after-install.tpl",
      "category": "Education"
    },

I get this error:

Error: Configuration is invalid.
 - configuration.linux should be one of these:
   object { artifactName?, asar?, asarUnpack?, category?, depends?, description?, desktop?, executableName?, extraFiles?, extraResources?, fileAssociations?, files?, forceCodeSigning?, icon?, maintainer?, packageCategory?, publish?, synopsis?, target?, vendor? } | {
     "type": "null"
   }
   Options related to how build Linux targets.

   Details:
    * configuration.linux has an unknown property 'afterInstall'. These properties are valid:
      object { artifactName?, asar?, asarUnpack?, category?, depends?, description?, desktop?, executableName?, extraFiles?, extraResources?, fileAssociations?, files?, forceCodeSigning?, icon?, maintainer?, packageCategory?, publish?, synopsis?, target?, vendor? }
    * configuration.linux should be null:
      {
        "type": "null"
      }

How to fix:
1. Open https://electron.build/configuration/configuration
2. Search the option name on the page.
  * Not found? The option was deprecated or not exists (check spelling).
  * Found? Check that the option in the appropriate place. e.g. "title" only in the "dmg", not in the root.

    at C:\Users\Codemotion\Documents\mbot-scratch-blocks\node_modules\read-config-file\src\main.ts:128:11
From previous event:
    at validateConfig (C:\Users\Codemotion\Documents\mbot-scratch-blocks\node_modules\read-config-file\out\main.js:133:22)
    at C:\Users\Codemotion\Documents\mbot-scratch-blocks\node_modules\electron-builder\src\util\config.ts:103:3
    at Generator.next (<anonymous>)
    at validateConfig (C:\Users\Codemotion\Documents\mbot-scratch-blocks\node_modules\electron-builder\out\util\config.js:100:22)
    at C:\Users\Codemotion\Documents\mbot-scratch-blocks\node_modules\electron-builder\src\packager.ts:146:11
    at Generator.next (<anonymous>)
    at runCallback (timers.js:781:20)
    at tryOnImmediate (timers.js:743:5)
    at processImmediate [as _immediateCallback] (timers.js:714:5)

linux question

Most helpful comment

Please move afterInstall to deb:

"build": {
  "appId": "com.codemotionkids.mbotjr",
  "linux": {
    "target": "deb",
    "category": "Education"
  },
  "deb": {
    "afterInstall": "after-install.tpl"
  }
}

All 2 comments

Please move afterInstall to deb:

"build": {
  "appId": "com.codemotionkids.mbotjr",
  "linux": {
    "target": "deb",
    "category": "Education"
  },
  "deb": {
    "afterInstall": "after-install.tpl"
  }
}

Sorry that it was not a breaking change.

Was this page helpful?
0 / 5 - 0 ratings