#Auto Updater

32 messages · Page 1 of 1 (latest)

dry viper
#

I have added this code to electron.js:

const { app, BrowserWindow, ipcMain, shell, dialog } = require('electron');
const { autoUpdater } = require("electron-updater");

autoUpdater.on("update-available", (_event, releaseNotes, releaseName) => {
    const dialogOpts = {
        type: 'info',
        buttons: ['Ok'],
        title: 'New version of KTaNEPad is available!',
        message: process.platform === 'win32' ? releaseNotes : releaseName,
        detail: 'A new version of KTaNEPad is available and being currently installed. It is recommended not to start a bomb while the update is installing as you might get another pop-up.'
    };

    dialog.showMessageBox(dialogOpts);
});

autoUpdater.on("update-downloaded", (_event, releaseNotes, releaseName) => {
    const dialogOpts = {
        type: 'info',
        buttons: ['Restart', 'Later'],
        title: 'Update installed!',
        message: process.platform === 'win32' ? releaseNotes : releaseName,
        detail: 'A new version of KTaNEPad has been downloaded. Would you like to restart now or later?'
    };

    dialog.showMessageBox(dialogOpts).then((returnValue) => {
        if(returnValue.response === 0) autoUpdater.quitAndInstall();
    });
});

I have added autoUpdater.checkForUpdates(); to the on ready function below createWindow().

#

This is in my package.json (also changing version):

"build": {
    "extends": null,
    "appId": "tk.gameprost.ktanepad",
    "productName": "KTaNEPad",
    "copyright": "GameProst",
    "win": {
      "publish": {
        "provider": "github",
        "owner": "Cirax856",
        "repo": "ktanepad"
      },
      "target": [
        "nsis"
      ],
      "icon": "public/ktanepadlogo.ico"
    },
    "files": [
      "dist/**/*",
      "build/**/*",
      "node_modules/**/*",
      "package.json"
    ],
    "directories": {
      "buildResources": "assets"
    },
    "nsis": {
      "oneClick": false,
      "installerIcon": "public/install.ico",
      "uninstallerIcon": "public/uninstall.ico",
      "uninstallDisplayName": "Uninstall KTaNEPad",
      "license": "license.md",
      "allowToChangeInstallationDirectory": true
    },
    "publish": {
        "provider": "github",
        "owner": "Cirax856"
    }
  },
valid spindle
#

is there an actual problem with this? the design of listening to a ws isnt really the best idea

#

itd probably be better to have gh tags and just dynamically use those

#

is there a problem actually installing it?

dry viper
dry viper
#

because I want it to 😠

#

I have added code to show a dialog box when an update is available

valid spindle
#

you need to read the docs

#

you havent set an upstream url

dry viper
#

can I get docs link please?

#

the auto updater is taking me months to make work

dry viper
valid spindle
dry viper
#

I did read them I just couldn't find the issue

dry viper
valid spindle
#

??

dry viper
#

the exe isn't there

#

it's literally everything else

valid spindle
#

??

dry viper
#

just not the exe

#

when I run the installer, it creates these files only

valid spindle
#

so the installer doesnt work?

dry viper
#

no

valid spindle
#

so whats the problem??

dry viper
#

the installer doesn't work

#

it worked when I installed it without the autoupdater

#

no errors while building as well

dry viper
#

I mean it is in win-unpacked, but doesn't get installed through the installer?