How to use the electron-installer-common.ElectronInstaller function in electron-installer-common

To help you get started, we’ve selected a few electron-installer-common 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 electron-userland / electron-installer-windows / src / installer.js View on Github external
const glob = promisify(require('glob'))

const spawn = require('./spawn')

debug.log = console.info.bind(console)
const defaultLogger = debug('electron-installer-windows')

function defaultRename (dest, src) {
  const ext = path.extname(src)
  if (ext === '.exe' || ext === '.msi') {
    src = `<%= name %>-<%= version %>-setup${ext}`
  }
  return path.join(dest, src)
}

class SquirrelInstaller extends common.ElectronInstaller {
  get contentFunctions () {
    return [
      'copyApplication',
      'createSpec'
    ]
  }

  get packagePattern () {
    return path.join(this.squirrelDir, '*')
  }

  get specPath () {
    return path.join(this.stagingDir, 'nuget', `${this.options.name}.nuspec`)
  }

  get squirrelDir () {
github electron-userland / electron-installer-debian / src / installer.js View on Github external
const defaultRename = (dest, src) => {
  return path.join(dest, '<%= name %>_<%= version %><% if (revision) { %>-<%= revision %><% } %>_<%= arch %>.deb')
}

/**
 * Transforms a SemVer version into a Debian-style version.
 *
 * Use '~' on pre-releases for proper Debian version ordering.
 * See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version
 */
function transformVersion (version) {
  return version.replace(/(\d)[_.+-]?((RC|rc|pre|dev|beta|alpha)[_.+-]?\d*)$/, '$1~$2')
}

class DebianInstaller extends common.ElectronInstaller {
  get contentFunctions () {
    return [
      'copyApplication',
      'copyLinuxIcons',
      'copyScripts',
      'createBinarySymlink',
      'createControl',
      'createCopyright',
      'createDesktopFile',
      'createOverrides'
    ]
  }

  get defaultDesktopTemplatePath () {
    return path.resolve(__dirname, '../resources/desktop.ejs')
  }
github electron-userland / electron-installer-redhat / src / installer.js View on Github external
const debug = require('debug')
const fs = require('fs-extra')
const path = require('path')
const wrap = require('word-wrap')

const redhatDependencies = require('./dependencies')
const spawn = require('./spawn')
const util = require('./util')

const defaultLogger = debug('electron-installer-redhat')

const defaultRename = function (dest, src) {
  return path.join(dest, '<%= name %>-<%= version %>-<%= revision %>.<%= arch %>.rpm')
}

class RedhatInstaller extends common.ElectronInstaller {
  get baseAppDir () {
    return path.join('BUILD', 'usr')
  }

  get contentFunctions () {
    return [
      'copyApplication',
      'copyLinuxIcons',
      'createBinarySymlink',
      'createCopyright',
      'createDesktopFile',
      'createSpec'
    ]
  }

  get defaultDesktopTemplatePath () {