Search code examples
windows-installerelectron

Electron app not seeing updates in the installed application


Firstly here is the GitHub repo because this code is too large to paste into here, https://github.com/HolyBreadstick/Electron-Hello-World/tree/master/AngularProfile-Page

Alright onto my question: So I have been following about a hundred different blog posts on how to setup an electron app. I can very easily get my app running on my system with a command I created called npm run electron-dev. When doing this I can see that changes are being applied to my application. Now I have followed a guide on how to create the package for my electron app, sadly though I think I messed a step up within this.

  1. Firstly, I created a secondary package.json file within my src folder that has some metadata within it. What's the point of this file if my createInstaller.js has some of the same metadata.
  2. I created a script called npm run windows-installer which is a way of calling all my major build scripts and packager. If I run this after making a change to anything in my view code, when the installer script completes I run the setup.exe file and notice that none of my changes have been applied.
  3. I thought I followed a guide on how to setup the installer events for creating the shortcut icon and so on, that step never worked because I don't see an icon in my start menu.

I understand that this question is a bit broad I am having trouble narrowing it down because I am not finding good guides that lay out the whole process for creating, packaging, installing, updating an electron app for windows.


Solution

  • First of all, there are many different ways of packaging/building electron apps (all of these are cross-platform as well):

    • Electron Packager- pretty basic and mostly from the command line
    • Electron Builder- a little more advanced but very customizable
    • Electron Forge- gives you a nice template to get started with packaging already implemented. I think that's your best bet

    I would recommend looking at all of those and finding one that best fits your project.

    I would also recommend looking at other people's projects and looking at what they do. Awesome Electron Is a great resource for finding projects.

    But for your questions:

    1. Putting a package.json in the src gives electron-builder metadata and dependency info, and what you have in your createInstaller.js is giving electron-winstaller metadata
    2. This might be a problem with the version number. Try Updating the version number
    3. Looking at this blog post might help with the icon problem