Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
app-builder-lib
Advanced tools
The app-builder-lib npm package is a library designed to facilitate the building and packaging of applications, particularly Electron applications. It provides a range of tools and utilities to streamline the process of creating distributable versions of your app for different platforms.
Building Electron Applications
This feature allows you to build Electron applications for multiple platforms (macOS, Windows, Linux) using a single configuration object. The code sample demonstrates how to set up a basic build configuration and initiate the build process.
const { build } = require('app-builder-lib');
build({
config: {
appId: 'com.example.app',
productName: 'ExampleApp',
directories: {
output: 'dist',
buildResources: 'resources'
},
files: ['**/*'],
mac: {
target: 'dmg'
},
win: {
target: 'nsis'
},
linux: {
target: 'AppImage'
}
}
}).then(() => {
console.log('Build successful!');
}).catch(err => {
console.error('Build failed:', err);
});
Code Signing
This feature provides the ability to sign your application code, which is essential for distribution on certain platforms like Windows. The code sample shows how to sign an application using a certificate file.
const { sign } = require('app-builder-lib');
sign({
path: 'path/to/your/app',
platform: 'win32',
certificateFile: 'path/to/certificate.pfx',
certificatePassword: 'your-password'
}).then(() => {
console.log('Code signing successful!');
}).catch(err => {
console.error('Code signing failed:', err);
});
Auto-Update Integration
This feature allows you to integrate auto-update functionality into your application by publishing updates to a specified provider. The code sample demonstrates how to publish updates to a GitHub repository.
const { publish } = require('app-builder-lib');
publish({
provider: 'github',
owner: 'your-github-username',
repo: 'your-repo-name',
token: 'your-github-token'
}).then(() => {
console.log('Publishing successful!');
}).catch(err => {
console.error('Publishing failed:', err);
});
electron-builder is a complete solution to package and build a ready-for-distribution Electron app for macOS, Windows, and Linux. It is similar to app-builder-lib in that it provides a comprehensive set of tools for building and packaging Electron applications. However, electron-builder is more widely used and has a larger community, which can be beneficial for support and finding resources.
electron-packager is a command-line tool and Node.js library that bundles Electron-based application source code with a renamed Electron executable and supporting files into folders ready for distribution. It is simpler and more lightweight compared to app-builder-lib, making it a good choice for smaller projects or those with less complex build requirements.
electron-forge is a complete tool for creating, publishing, and installing modern Electron applications. It aims to be a one-stop solution for getting your Electron app up and running. While it offers similar functionalities to app-builder-lib, it also includes features for scaffolding new projects and managing dependencies, making it a more holistic solution for Electron app development.
⚠️ It is developer documentation. If your are looking for usage guide, see user documentation.
NSIS stands for Nullsoft Scriptable Install System. electron-builder utilizes a customized version of it and uses NsisMultiUser
plugin to handle installation for single user or all users on the computer.
http://www.mathiaswestin.net/2012/09/how-to-make-per-user-installation-with.html
https://github.com/Drizin/NsisMultiUser
NSIS vs Inno Setup — it is not easy to choose because both are far from ideal, e.g. inno also doesn't have built-in per-user installation implementation — http://stackoverflow.com/questions/34330668/inno-setup-custom-dialog-with-per-user-or-per-machine-installation.
One-click installer: http://forums.winamp.com/showthread.php?t=300479
For translators, the strings to be displayed are included in assistedMessages.yml
and [messages.yml
]https://github.com/electron-userland/electron-builder/blob/master/packages/app-builder-lib/templates/nsis/messages.yml).
As for other strings in NSIS, head to electron-userland/electron-builder-binaries or the upstream repository on Sorceforge.
See docs.
We use UUID v5 to generate sha-1 name-based UUID.
http://stackoverflow.com/questions/3029994/convert-uri-to-guid https://alexandrebrisebois.wordpress.com/2013/11/14/create-predictable-guids-for-your-windows-azure-table-storage-entities/ https://github.com/Squirrel/Squirrel.Windows/pull/658
NSIS LZMA compression is slower and worse compared to external 7za
compression. Slower because 7za
is multi-threaded, worse because LZMA codec implementation is outdated and BCJ2 filter is not enabled.
Difference for test app — 4 MB (before: 36.3 after: 32.8).
And compression time is also greatly reduced.
Since NSIS is awesome, no disadvantages in our approach — compression is disabled before File /oname=app.7z "${APP_ARCHIVE}"
and enabled after (it is the reasons why SOLID
compression is not used).
So, opposite to Squirrel.Windows, archive is not twice compressed.
So, in your custom NSIS scripts you should not use any compression instructions. Only SetCompress
if you need to disable compression for already archived file.
build
flow) (#8150) (f4e6ae2)MinVersion
and MaxVersionTested
fields in appx manifest (#8142) (8160363)altool
is no longer supported) (#8159) (15bffa0)FAQs
electron-builder lib
The npm package app-builder-lib receives a total of 123,726 weekly downloads. As such, app-builder-lib popularity was classified as popular.
We found that app-builder-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.