'Distributing an Electron app on Windows, Mac and Linux
I've spend my weekend experimenting with Electron and this caused a few questions and dilemmas in my head.
I cloned the following Github repository to test with: electron-vue-typescript-starter
This project uses electron-builder
to build the project, based on the host platform you're developing on. Since I'm developing on Windows it builds an .exe
file.
Apart from the .exe
there are also some other files. The following files were made by electron-builder
on windows
:
| win-unpacked
|--- (lots of DDL's + electron-application.exe)
--- electron-builder.yaml
--- electron-application setup 0.0.0.exe
--- electron-application setup 0.0.0.exe.blockmap
--- latest.yml
Question 1: If I want to distribute the application for public usage, what should users download? The .exe
setup only? Or do they need some/all of the other files aswell?
After setting up a macOS VM I've managed to build the application for the darwin
platform too. The following files were made by electron-builder
on darwin
:
| github
|--- latest-mac.json
| mac
|--- electron-application.app
--- electron-builder.yaml
--- electron-application-0.0.0-mac.zip
--- electron-application-0.0.0.dmg
--- electron-application-0.0.0.dmg.blockmap
--- latest-mac.yml
Question 2: What do the users need from above to use/install the application on the darwin
platform?
Question 3: I haven't build the application for linux
yet. But how do I distribute the linux
edition? Would this be similar to the darwin
one?
Note: I have read some parts of the electron-builder
documentation but it it's really abstract and doesn't explain (as far as I could see) how someone would distribute the build contents.
The cleanest way would be a single .exe
file for windows
and a single .zip
or .dmg
for darwin
. But what are the other files for? What should I do with them, because they are there for a reason, right?
Solution 1:[1]
For distribution, you need to provide an installer (msi) for windows user.
- You need to follow below link, which will answer all your questions.
Above tutorial also provide information about creating Debian package.
Solution 2:[2]
You will need to serve them with the entire folder contents. When they run the .exe, it references the other files to complete the installation
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Rohan J Mohite |
Solution 2 | Mpwanyi Samuel |