2

As this post : Electron auto update fails silently when installing update on Windows

I can't install my new update :( check update, download is good but during installation of the update, the progress bar fills up halfway, then disappears.

The app remains closed and does not automatically relaunch after the progress bar disappears.

i don't have error with log... i use the v4.2.0 of electron-updater.

[UPDATE]

waiting the real solution i have make this code for auto-update on windows :

if(process.platform != 'win32') {
   autoUpdater.quitAndInstall();
} else {
   // to find info of next version get pair "filename":"<appName>-Setup-<version>.exe"
   let pathOfPending = homedir + '\\AppData\\Local\\' + process.env.npm_package_name + '-updater\\pending\\';
   let updateInfo = JSON.parse(fs.readFileSync(pathOfPending + 'update-info.json'));
   console.log(updateInfo.fileName);
   exec(pathOfPending + updateInfo.fileName, function(err, data) {
      console.log(err);
      //don't forget to exit your app because the setup launches the app too
   });
}
4

1 回答 1

0

检查您createBroswser是否已将可关闭设置为 false。

如果您设置了可关闭 = false,请将其删除。

于 2021-01-13T06:37:49.380 回答