Electron forge - create latest.yml for electron-updater

209 Views Asked by At

I have migrated our ReactJS app to Electron forge using webpack. Now I have created .exe file but I'm strugling with electron-updater bacause of missing latest.yml file. How do I create this file with electron-forge make so electron-updater can update the app?

package.json

{
    "name": "app-electron",
         "version": "1.5.3",
         "description": "My app description",
    "config": {
        "forge": {
          "plugins": [
            {
              "name": "@electron-forge/plugin-webpack",
              "config": {
                "devContentSecurityPolicy": "default-src * self blob: data: gap:; style-src * self 'unsafe-inline' blob: data: gap:; script-src * 'self' 'unsafe-eval' 'unsafe-inline' blob: data: gap:; object-src * 'self' blob: data: gap:; img-src * self 'unsafe-inline' blob: data: gap:; connect-src self * 'unsafe-inline' blob: data: gap:; frame-src * self blob: data: gap:;",
                "mainConfig": "./webpack.main.config.js",
                "renderer": {
                  "config": "./webpack.renderer.config.js",
                  "entryPoints": [
                    {
                      "name": "main_window",
                      "html": "./src/index.html",
                      "js": "./src/index.js",
                      "preload": {
                        "js": "./src/preload.js"
                      }
                    }
                  ]
                }
              }
            }
          ],
          "makers": [
            {
              "name": "@electron-forge/maker-squirrel",
              "config": {
                "name": "app-electron",
                "loadingGif": "loading.gif",
                "icon": "icon.ico"
              }
            }
          ]
        }
      },
    ...
}
1

There are 1 best solutions below

0
jo-cor On

electron-forge does not automatically craetes a latest.yml file, at the end there's an example of my file so you can create it manually but it's strongly recommended to use electron-builder instead which correctly creates the missing file and in turn is correctly picked-up by electron-updater, i.e.

version: 0.0.18
files:
  - url: App.exe
    sha512: NQOV/xxxxxxxxxx==
    size: 100527708
path: App.exe
sha512: NQOV/yyyyyyyyyy==
releaseNotes: "[this is the content of the app.release-notes.md file referenced at\r\npackage.json/build/releaseInfo/releaseNotesFile]"
releaseDate: '2023-12-14T14:42:57.334Z'