Package electron app as installer for Windows, Linux and MacOS


#1

Hi Everyone!
I have developed an electron app and know i want to package that as cross platform installer, I have packaged that as windows .exe file using following commands
" npm install electron-packager -g " to install electron packager
" electron-packager . " to package electron project as windows installer ".exe file"
it is perfectly running for window but i completely missing how to package it for Linux and MacOS? any help please.


#2

You might want to check out electron-builder which is a more complete solution than electron-packager.
Unfortunately, you will need a computer with macOS in order to build the Mac version of your application


#3

Thanx for your suggestion sir…!
I have used Electron-builder to package it and successfully compiled it as windows installer by this process
"npm add electron-builder -g" --this installed electon-builder globally on my machine “windows 8.1 OS”
“npm run dist” – This command compiled my project as .exe installer.
but still some misunderstanding is " do i need system with MacOS to build installer for Mac Installer and same Linux system to build installer for Linux ???"
Please make me clear on this point.


#4

You don’t necessarily need macOS in order to build a Mac app. However, you do need to be on the native platform if you want to use packages with native dependencies.
Also, if you want to publish a Mac app, you probably also want code signing which is only available on macOS.

You can read more about this here:
https://www.electron.build/multi-platform-build