Asbestos Awareness Week

This week is asbestos awareness week. Every year 4,000 Australians die of an asbestos-related disease. The trade union movement will always fight for the victims of asbestos and to stop people from…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Packaging Electron App

Packaging an Electron App means creating an installer which can be used for distribution. You can manually package your app as well but that would be troublesome.

There are modules available to fulfill this task. Especially two mentioned below:-

We would be using electron builder as it comes as a default part of electron installation and has built-in support for code-signing.If it is not installed by default below are the steps on how you can install electron builder

Installation:-

Install electron builder to your app as a devDependency. It is not recommended to install it globally.

Here is the command to do so:-

You can use npm as well but Yarn is recommended to use.

By default there will be 2 package.json files:-
1) Which gets created with angular
2) Which gets created with electron

Electron-builder supports single package.json file structure as well.

We will use one package.json file structure and for feasibility we will use electron-builder.json file as well.

It is also feasible to put all contents of electron-builder.json file to “build” tag in package.json file.

Electron-builder.json

Package.json:-

For Windows build “NSIS ”target can also be used which is default and recommended by electron-builder.

And it’s done. You have configured elecron-builder successfully.

Now to package your app into an installer use command:-

It will create an installer inside ./release folder.

Add a comment

Related posts:

Mongoose Schemas in Separate Files

Mongoose Schemas in Separate Files. They should follow a format similar to the example below. The export at the bottom ensure the Schema is visible in other files..

Intro To RAID

Although initially known as Redundant Array of Inexpensive Disks the name changed to Redundant Array of Independent Disks, RAID is a storage technology developed by a team at the University of…

Reset Button

The line is out the door. I am barely hanging on to four hours of sleep, and the excitement that has been gnawing at me ever since that cold January morning when I opened my mailbox and found a…