agecas.blogg.se

Create windows installer for electron app
Create windows installer for electron app






create windows installer for electron app

Now you need to understand 2 things, there is no way of doing it the easy way, like there is no one-click installer creator in electron that you can use, that cover all the 100% of the cases for you, some will expose your app source, or you will end up have a gigantic size of package app and will end up having your whole project including node module in the app source code, that is not what I want. Now you want to create an installer for it, There is a lot of articles that can help you, but in this, I am going to share my story of how I did it, and it is also for the people who are using electron and react together. node build.jsĪnd finally, you have your windows installer, a SETUP file for your electron application in folder created in step 6 ready to be distributed.So you have created up a great looking Electron-based app. And for the final step you will have to route back to the root folder of the application and run the following command. And the exe name will be the name of the exe generated in the appDirectory folder.Ĩ. The outputDirectory will be the name of folder you created in step 6. The appDirectory will be the the name of the folder that was created after running the electron-packager command (will usually end in …-win32-圆4).

create windows installer for electron app

NOTE- In the file above the values of appDirectory, outputDirectory, exe need to be changed according to your application folder names. this should be placed at top of main.js to handle setup events quickly if (handleSquirrelEvent(app)) ) In main.js file of electron application add the following lines of code at the start of the file. Route to the application folder and install squirrel.

  • Route to the root folder of application and install electron-winstaller through command line.Ģ.
  • Let’s start with the installation process. root folder / ├──applcation folder / ├── package.json ├── main.js └── index.html Following is the structure of a application folder.

    create windows installer for electron app

    Now, because we are going to go back and forth these two folders for installing various packages, the structure of the application folder needs to be clear.

    create windows installer for electron app

    Using electron-winstaller includes working with the application folder( the folder where all your code sub folders resides) and the root folder of the application folder (this folder consists of your application folder). Squirrel is a set of tools and a library, to completely manage installation and updating of Desktop Windows application. Electron-winstaller : The windows installer for ElectronĮlectron-winstaller is a NPM module that builds windows installer for windows application using Squirrel.








    Create windows installer for electron app