how to make MSI file from electron app that is made by react

518 views Asked by At

I made an electron app with react, but I don't know how to make its MSI file for windows. actually, I know what the problem is, it is because Reac app needs to run on localhost:3000 and after that electron can launch it through mainWindow.loadURL, but the MSI file doesn't work like this, and it doesn't launch it, please help me how to solve this problem note: in development, it works fine because I first run the react app and then the electron app which causes it can load URL from localhost:3000 but when I make its MSI file through the electron packager then it doesn't work

1

There are 1 answers

1
reZach On

You want to use electron-builder to make an .msi file. The necessary command to build a windows app (once you've gotten your electron app set up) is electron-builder --windows.

If you want to use a template with all of this already set up, you can use secure-electron-template. Disclaimer: I am the author of this template.