


For example, if you wanted to send a command to tell the app to quit, you would do the following: // inside the main process (e.g. The most common way to do that is to use the ipcRenderer to send and receive messages. Communicating with the Main ProcessĪs far as I could tell, the Electron docs do not cover communicating between the app and the main process. Below are some common problems I ran into and their solutions. However, problems arose as I started trying to integrated Electron APIs into my app. The Electron Quick Start Guide was indeed quick and I was able to get my app booted in Electron following their guide without any problems. I found building an app to be the easiest part of the whole process. Prerequisites for Packaging Windows Apps on Macīefore you can package an Electron app, you first must build one.This guide will only cover Electron itself and its various tools. What this guide does not cover are the various ways to integrate Electron into different frameworks, for example Wepback. It will also try to help you avoid the pitfalls I stumbled into while learning them. This guide aims to help you navigate these different tools and how to use them so you can choose the right one for your needs. Each does a slightly different thing and figuring out which one to use to do what I wanted was difficult.

Each one claims to be either a "complete tool" or "complete solution" to create, package, and distribute an Electron app. There's electron-forge, election-packager, and election-builder. The main problem I had was that there are lots of different tools and ways to package an app. I say gauntlet as the entire process of figuring out all the different ways there are to package an app for distribution was quite exhausting and a bit frustrating. You can get debug messages from this package by running with the environment variable DEBUG=electron-windows-installer:main e.g.I recently went through the gauntlet that is trying to build and package an Electron app. Another thing to be aware of is that, since the app is spawned by squirrel and squirrel acquires a file lock during installation, you won't be able to successfully check for app updates till a few seconds later when squirrel releases the lock. This allows you to do things like showing up a splash screen or presenting a settings UI. Notice that the first time the installer launches your app, your app will see a -squirrel-firstrun flag. NB: Use this syntax within an async function, Node does not have support for // top-level await as of Node 12.
