How to use electron-packager - 10 common examples

To help you get started, we’ve selected a few electron-packager 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 henryboldi / felony / package.js View on Github external
arch,
    'prune': true,
    'app-version': pkg.version || DEFAULT_OPTS.version,
    'out': `release/${ plat }-${ arch }`,
  })

  if (`${ plat }-${ arch }` === 'darwin-x64') {
    opts['osx-sign'] = {
      app: '/release/darwin-x64/Felony-darwin-x64/Felony.app',
      identity: 'xxxxxxxxx', // Developer ID Application: * (*)
    }
  }

  console.log('opts', opts)

  packager(opts, cb)
}
github atom / atom / script / lib / package-application.js View on Github external
'use strict';

const assert = require('assert');
const childProcess = require('child_process');
const electronPackager = require('electron-packager');
const fs = require('fs-extra');
const hostArch = require('electron-packager/targets').hostArch;
const includePathInPackagedApp = require('./include-path-in-packaged-app');
const getLicenseText = require('./get-license-text');
const path = require('path');
const spawnSync = require('./spawn-sync');
const template = require('lodash.template');

const CONFIG = require('../config');
const HOST_ARCH = hostArch();

module.exports = function() {
  const appName = getAppName();
  console.log(
    `Running electron-packager on ${
      CONFIG.intermediateAppPath
    } with app name "${appName}"`
  );
  return runPackager({
    appBundleId: 'com.github.atom',
    appCopyright: `Copyright © 2014-${new Date().getFullYear()} GitHub, Inc. All rights reserved.`,
    appVersion: CONFIG.appMetadata.version,
    arch: process.platform === 'darwin' ? 'x64' : HOST_ARCH, // OS X is 64-bit only
    asar: { unpack: buildAsarUnpackGlobExpression() },
    buildVersion: CONFIG.appMetadata.version,
    derefSymlinks: false,
github electron-userland / electron-forge / packages / api / core / src / api / package.ts View on Github external
if (!packageJSON.version && !packageOpts.appVersion) {
    // eslint-disable-next-line max-len
    warn(interactive, 'Please set "version" or "config.forge.packagerConfig.appVersion" in your application\'s package.json so auto-updates work properly'.yellow);
  }

  if (packageOpts.prebuiltAsar) {
    throw new Error('config.forge.packagerConfig.prebuiltAsar is not supported by Electron Forge');
  }

  await runHook(forgeConfig, 'generateAssets');
  await runHook(forgeConfig, 'prePackage');

  d('packaging with options', packageOpts);

  await packager(packageOpts);

  await runHook(forgeConfig, 'postPackage');

  if (packagerSpinner) packagerSpinner!.succeed();
};
github expo / xde / gulp / package-tasks.js View on Github external
async function packageAppAsync(signed) {
  await checkNativeModulesVersionAsync();

  let [xdeVersion, electronVersion] = await Promise.all([
    JsonFile.getAsync(path.join(XDE_ROOT, 'package.json'), 'version'),
    getElectronVersionAsync(),
  ]);

  let iconPath = path.join(XDE_ROOT, 'dev/xde.icns');
  let appPath = await electronPackager.promise({
    dir: path.resolve(__dirname, '..'),
    name: APP_NAME,
    platform: PLATFORM,
    arch: ARCH,
    version: electronVersion,
    'app-bundle-id': APP_BUNDLE_ID,
    'app-copyright': `Copyright (c) ${new Date().getFullYear()} Exponent`,
    'build-version': xdeVersion,
    icon: iconPath,
    ignore: [/^\/src(\/|$)/, /^\/\.babelrc$/],
    overwrite: true,
    prune: true,
    'osx-sign': signed ? { identity: CODE_SIGNING_IDENTITY } : null,
    // sign: signed ? CODE_SIGNING_IDENTITY : null,
  });
github bluedaniel / Kakapo-app / gulpfile.babel.js / tasks / package.js View on Github external
["linux", "win32", "darwin"].forEach(plat => {
      packager(assign({}, DEFAULT_OPTS, {
        platform: plat,
        arch: "x64",
        out: config.tempDirectory + "/" + plat
      }), () => console.log(plat + " finished!"));
    });
  })
github toyobayashi / mishiro / script / packager.ts View on Github external
}).then(() => {
  return packager(packagerOptions)
}).then(appPaths => {
  let dirName: string | string[] = path.basename(appPaths[0]).split('-')
github electron-userland / electron-forge / packages / api / core / src / util / parse-archs.ts View on Github external
export default function parseArchs(
  platform: ForgePlatform | string,
  declaredArch: ForgeArch | 'all' | string,
  electronVersion: string,
): ForgeArch[] {
  if (declaredArch === 'all') {
    return allOfficialArchsForPlatformAndVersion(platform, electronVersion) || ['x64'];
  }

  return declaredArch.split(',') as ForgeArch[];
}
github electron-userland / electron-forge / packages / api / core / src / util / parse-archs.js View on Github external
export default function parseArchs(platform, declaredArch, electronVersion) {
  if (declaredArch === 'all') {
    return allOfficialArchsForPlatformAndVersion(platform, electronVersion) || ['x64'];
  }

  return declaredArch.split(',');
}
github Urucas / electron-packager-interactive / lib / index.js View on Github external
function runElectronPackager (settings) {
    log.log('Electron packager settings:')
    log.log(settings)
    packager(settings, (err, appPath) => {
      if (err) {
        return error(err)
      }
      log.ok(`Application packaged successfully to '${appPath}'`)
    })
  }

electron-packager

Customize and package your Electron app with OS-specific bundles (.app, .exe, etc.) via JS or CLI

BSD-2-Clause
Latest version published 6 months ago

Package Health Score

76 / 100
Full package analysis