Giter VIP home page Giter VIP logo

electron-forge-maker-portable's Introduction

Electron Forge Maker Portable

Electron Forge Maker for portable Windows apps

Electron Forge Maker Portable is a Maker plugin for Electron Forge that allows you to bundle your Electron files into a single standalone & portable .exe file on Windows.

Installation

yarn add -D @rabbitholesyndrome/electron-forge-maker-portable

or

npm install --save-dev @rabbitholesyndrome/electron-forge-maker-portable

Usage

Add it to your electron-forge Maker config:

{
  "config": {
    "forge": {
      "makers": [
        {
          "name": "@rabbitholesyndrome/electron-forge-maker-portable"
        }
      ]
    }
  }
}

Then run electron-forge make:

yarn make
# or `yarn electron-forge make`

or

npm run make
# or `npx electron-forge make`

Background

In electron-forge, the only built-in way to package Windows binaries is using the Squirrel.Windows Maker. Why do we need to package Electron apps? Electron requires a bunch of extra files and dependencies (eg. .dll files) in order for the .exe file to run, so we need a way to distribute all of these files together.

Squirrel.Windows works great if you are okay with an "installer" .exe that unpacks all the files to a location on the user's PC. If you wish to have a single portable .exe instead, this will not work.

Other Electron tools like electron-builder support additional targets on top of Squirrel.Windows, specifically NSIS (Nullsoft Scriptable Install System). NSIS is capable of bundling all of the Electron files into a single portable .exe file.

This plugin injects electron-builder's NSIS portable builder logic into electron-forge as a Maker plugin so that you can build portable .exe files while staying within the Electron Forge ecosystem.

Config

This Maker accepts a config property. Anything passed to config will get merged into electron-builder's configuration before it is executed by electron-builder:

{
  "config": {
    "forge": {
      "makers": [
        {
          "name": "@rabbitholesyndrome/electron-forge-maker-portable",
          "config": {
            "appId": "com.example.app"
          }
        }
      ]
    }
  }
}

Specifically you might be interested in the nsis/portable config options:

{
  "config": {
    "forge": {
      "makers": [
        {
          "name": "@rabbitholesyndrome/electron-forge-maker-portable",
          "config": {
            "portable": {
              "artifactName": "${productName}-app-${version}.${ext}"
            }
          }
        }
      ]
    }
  }
}

Please see the electron-builder documentation for all the configuration options available.

License

MIT

electron-forge-maker-portable's People

Contributors

gregnr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.