How to use the electron-builder.init function in electron-builder

To help you get started, we’ve selected a few electron-builder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / electron-builder / electron-builder-tests.ts View on Github external
icon: "icon.icns",
			"icon-size": 80,
			background: "installer.png",
			contents: [
				{ x: 438, y: 344, type: "link", path: "/Applications" },
				{ x: 192, y: 344, type: "file" },
			]
		},
		win: {
			title: "myapplication",
			icon: "icon.ico"
		}
	}
}, callback);

const bldr = require("electron-builder").init();

bldr.build({
	appPath: ".",
	out: "out",
	platform: "osx",
	config: {
		osx: {
			title: "myapplication",
			icon: "icon.icns",
			"icon-size": 80,
			background: "installer.png",
			contents: [
				{ x: 438, y: 344, type: "link", path: "/Applications" },
				{ x: 192, y: 344, type: "file" },
			]
		},
github DefinitelyTyped / DefinitelyTyped / electron-builder / electron-builder-tests.ts View on Github external
import * as factory from "electron-builder";
const builder = factory.init();

function callback(err: Error) {
	const msg = err.message;
}

builder.build({
	appPath: ".",
	out: "out",
	platform: "win",
	config: {
		osx: {
			title: "myapplication",
			icon: "icon.icns",
			"icon-size": 80,
			background: "installer.png",
			contents: [
github zalmoxisus / crossbuilder / gulp / tasks / compress.js View on Github external
del([`./build/${config.productName}.dmg`]).then(paths => {
    console.warn('paths', paths);
    const builder = electronBuilder.init();
    builder.build({
      appPath: path.resolve(
        `./build/executables/${config.productName}-darwin-x64/${config.productName}.app`
      ),
      platform: 'osx',
      out: path.resolve('./build'),
      config: './src/electron/resources/config.json'
    }, function (err) {
      if (err) console.error(err);
    });
  });
});
github appcelerator-labs / appc-docs-desktop / build.js View on Github external
var child_process = require('child_process');
var path = require('path');

var async = require('async');
var builder = require('electron-builder').init();
var fs = require('fs-extra');
var packager = require('electron-packager');
var ProgressBar = require('progress');
var request = require('request');
var rimraf = require('rimraf');
var unzip = require('unzip');

var pkg = require('./package.json');
var config = require('./builder.json');

exports.cleanTmp = function (callback) {
	rimraf('tmp', callback);
};

exports.cleanDist = function (callback) {
	rimraf('dist', callback);
github develar / onshape-desktop-shell / build / build.js View on Github external
util.reportResult(spawnSync("zip", ["-ryX", `${outDir}/${appName}-${version}-mac.zip`, appName + ".app"], {
        cwd: outDir,
        stdio: "inherit",
      }))
    }
    else {
      fs.renameSync(path.join(outDir, arch, "OnshapeSetup.exe"), path.join(outDir, "OnshapeSetup-" + version + ((arch === "x64") ? "-x64" : "") + ".exe"))
    }

    if (doneHandler != null) {
      doneHandler()
    }
  }

  if (args.platform === "darwin") {
    require("electron-builder").init().build({
      "appPath": appPath,
      "platform": args.platform === "darwin" ? "osx" : "win",
      "out": outDir,
      "config": path.join(__dirname, "packager.json"),
    }, callback)
  }
  else {
    require('electron-installer-squirrel-windows')({
      name: metadata.name,
      path: appPath,
      product_name: metadata.name,
      out: path.join(outDir, arch),
      version: version,
      description: metadata.description,
      authors: metadata.authors,
      setup_icon: path.join(__dirname, "icon.ico"),