Electron-builder: build with platform and arch arguments doesn't build package

Created on 25 Mar 2016  Â·  9Comments  Â·  Source: electron-userland/electron-builder

electron-builder versions: at least 3.0.1 and 2.10.1.

windows 7 x64
npm v 2.14.20
node v 4.4.0

two package.json layout, outer package.json:

{
  "license": "proprietary",
  "private": true,
  "build": {
    "win": {
      "extraResources": [
        "./*.dll",
        "printsupport",
        "platforms"
      ],
      "noMsi": true,
      "app-bundle-id": "ru.orbilet.orbiletClient",
      "app-category-type": "public.app-category.business",
      "iconUrl": "http://rghost.net/download/private/8MZF2wPky/4b51dc91c2b4c7d0a27417e384c26080/60f3daf2eb6a28a2c3402ab4ad0f98346bf61660/60f3daf2eb6a28a2c3402ab4ad0f98346bf61660/OrbiletClient.ico"      
    }
  },
  "scripts": {
    "postinstall": "install-app-deps",
    "start": "./node_modules/.bin/electron app",
    "dist": "./node_modules/.bin/build",
    "dist:win": "./node_modules/.bin/build --platform win32",
    "dist:x64": "./node_modules/.bin/build --arch x64",
    "dist:win64": "./node_modules/.bin/build --platform win32 --arch x64"
  },
  "devDependencies": {
    "babel-cli": "^6.6.4",
    "babel-core": "^6.6.4",
    "babel-preset-es2015": "^6.6.0",
    "babel-preset-react": "^6.5.0",
    "babel-preset-stage-0": "^6.5.0",
    "babelify": "^7.2.0",
    "browserify": "^12.0.1",
    "electron-builder": "^3.0.1",
    "electron-prebuilt": "^0.36.0",
    "gulp": "^3.9.1",
    "gulp-babel": "^6.1.2",
    "gulp-concat": "^2.6.0",
    "gulp-notify": "^2.2.0",
    "gulp-sourcemaps": "^1.6.0",
    "gulp-util": "^3.0.7",
    "vinyl-source-stream": "^1.1.0",
    "watchify": "^3.6.1",
    "winreg": "0.0.13"
  }
}

npm run dist builds ./dist/MyApp-win32-ia32, ./dist/MyApp-win32-x64 with unpackaged version and ./dist/win, ./dist/win-x64 with packaged.

npm run dist:win64 ("build --platform win32 --arch x64") builds directory ./dist/MyApp-win32-x64 only, where non-packaged app is located.

feature windows

Most helpful comment

It is not a bug. If script is not named as dist, --dist flag is not implied, and, so, you must pass it explicitly. Well, I will improve lifecycle event support — prefix dist: will be also as marker to package in a distributable format.

All 9 comments

Why do you need to have dist:win64 and dist:win? Maybe electron-builder by default should build only current arch, but not all?

@develar, no, build with no arguments builds 32-bit arch too and it takes much time

npm run dist builds ./dist/MyApp-win32-ia32, ./dist/MyApp-win32-x64 with unpackaged version and ./dist/win, ./dist/win-x64 with packaged.

@d9k I think we should change this behaviour and by default build only current arch. Do you agree?

@develar I agree but packaged version (squirrel installer) must be built too.
But question is: why any argument passed to build cancels installer build (only non-packaged version is being build)? No warnings or errors. I can give you build logs if you tell me how to make them.

Well, yes, it seems it is a bug. Will be investigated and fixed.

I agree

Ok, so, it will be implemented. win 32/linux 32 in any case doesn't make any sense in most cases.

It is not a bug. If script is not named as dist, --dist flag is not implied, and, so, you must pass it explicitly. Well, I will improve lifecycle event support — prefix dist: will be also as marker to package in a distributable format.

Thanks! You improved our workflow enormously!
Awesome support!

We can also support magic script names like dist:${platformName}${arch}

dist:win64 (implies --dist --platform win32)

but... it is not yet clear for me how does it important (since we by default build only current arch). And it can be too magical. Feel free to propose.

Awesome support!

Thanks :)

@develar thanks, I think it's already very usable ;)

Was this page helpful?
0 / 5 - 0 ratings