Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
grunt-electron-debian-installer
Advanced tools
Create a Debian package for your Electron app.
🚨 This package has been renamed to grunt-electron-installer-debian
! 🚨
This tool requires fakeroot
and dpkg
to build the .deb
package.
I'd recommend building your packages on your target platform, but if you insist on using Mac OS X, you can install these tools through Homebrew:
$ brew install fakeroot dpkg
This plugin requires Grunt ~0.4.0
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-electron-debian-installer --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-electron-debian-installer');
This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that you upgrade, but in case you can't please use v0.3.2.
Run this task with the grunt electron-debian-installer
command.
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
Say your app lives in path/to/app
, and has a structure like this:
$ tree path/to/app/ -L 2
path/to/app/
├── LICENSE
├── index.js
├── main
│ ├── index.js
│ └── squirrel.js
├── node_modules
│ ├── fs-plus
│ └── yargs
├── package.json
└── renderer
├── index.css
├── index.html
└── index.js
To create a .deb
package from your app, the configuration for your task would look like this:
'electron-debian-installer': {
app: {
options: {
arch: 'i386'
},
src: 'path/to/app/',
dest: 'path/to/out/'
}
}
The task will try to extract all necessary information from your package.json
, and then generate your package at path/to/out
.
You can also create different packages for different architectures, while manually overriding certain options:
'electron-debian-installer': {
options: {
productName: 'Foo',
productDescription: 'Bar baz qux.',
section: 'devel',
priority: 'optional',
lintianOverrides: [
'changelog-file-missing-in-native-package',
'executable-not-elf-or-script',
'extra-license-file'
],
categories: [
'Utility'
],
rename: function (dest, src) {
return dest + '<%= name %>_<%= version %>-<%= revision %>_<%= arch %>.deb';
}
},
linux32: {
options: {
arch: 'i386'
},
src: 'path/to/linux32/',
dest: 'path/to/out/linux32/'
},
linux64: {
options: {
arch: 'amd64'
},
src: 'path/to/linux64/',
dest: 'path/to/out/linux64/'
}
}
Type: String
Default: undefined
Path to the folder that contains your built Electron application.
Type: String
Default: undefined
Path to the folder that will contain your Red Hat installer.
Type: String
Default: package.name
Name of the package (e.g. atom
), used in the Package
field of the control
specification.
According to the Debian Policy Manual:
Package names [...] must consist only of lower case letters (a-z), digits (0-9), plus (+) and minus (-) signs, and periods (.). They must be at least two characters long and must start with an alphanumeric character.
Type: String
Default: package.productName || package.name
Name of the application (e.g. Atom
), used in the Name
field of the desktop
specification.
Type: String
Default: package.genericName || package.productName || package.name
Generic name of the application (e.g. Text Editor
), used in the GenericName
field of the desktop
specification.
Type: String
Default: package.description
Short description of the application, used in the Description
field of the control
specification.
Type: String
Default: package.productDescription || package.description
Long description of the application, used in the Description
field of the control
specification.
Type: String
Default: package.version
Version number of the package, used in the Version
field of the control
specification.
Type: String
Default: package.revision
Revision number of the package, used in the Version
field of the control
specification.
Type: String
Default: "utils"
Application area into which the package has been classified, used in the Section
field of the control
specification.
You can read more about sections, and also check out the list of existing sections in Debian unstable.
Type: String
Default: "optional"
How important it is that the user have the package installed., used in the Priority
field of the control
specification.
You can read more about priorities.
Type: String
Default: undefined
Machine architecture the package is targeted to, used in the Architecture
field of the control
specification.
For possible values see the output of dpkg-architecture -L
.
Type: Integer
Default: size of the folder
Estimate of the total amount of disk space required to install the named package, used in the Installed-Size
field of the control
specification.
Type: Array[String]
Default: []
Relationships to other packages, used in the Depends
, Recommends
, Suggests
, Enhances
and Pre-Depends
fields of the control
specification.
Type: String
Default: package.author.name (package.author.email)
Maintainer of the package, used in the Maintainer
field of the control
specification.
Type: String
Default: package.homepage || package.author.url
URL of the homepage for the package, used in the Homepage
field of the control
specification.
Type: String
Default: package.name
Relative path to the executable that will act as binary for the application, used in the Exec
field of the desktop
specification.
The generated package will contain a symlink /usr/bin/<%= options.name %>
pointing to the path provided here.
For example, providing this configuration:
{
options: {
name: 'foo',
bin: 'resources/cli/launcher.sh'
},
src: '...',
dest: '...'
}
Will create a package with the following symlink:
usr/bin/foo@ -> ../share/foo/resources/cli/launcher/sh
And a desktop specification with the following Exec
key:
Exec=foo %U
Type: String
Default: undefined
Path to the image that will act as icon for the application, used in the Icon
field of the desktop
specification.
Type: Array[String]
Default: []
Categories in which the application should be shown in a menu, used in the Categories
field of the desktop
specification.
For possible values check out the Desktop Menu Specification.
Type: Array[String]
Default: []
You can use these to quieten lintian
.
Type: Function
Default: function (dest, src) { return dest + src; }
Function that renames all files generated by the task just before putting them in your dest
folder.
git clone git://github.com/unindented/grunt-electron-debian-installer.git
Copyright (c) 2015 Daniel Perez Alvarez (unindented.org). This is free software, and may be redistributed under the terms specified in the LICENSE file.
FAQs
Create a Debian package for your Electron app.
We found that grunt-electron-debian-installer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.