electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.66k stars 1.74k forks source link

When installing the new version after download has finished it raise an error #7830

Open Taha-daboussi opened 1 year ago

Taha-daboussi commented 1 year ago

Hello, my auto-updater was functioning perfectly. However, after making changes to the productName, appId, and artifactName, it seems to have stopped working as expected. On macOS, the updater still works flawlessly, but on Windows, it detects the update, downloads it, and initiates the quitAndInstall process. However, during the installation of the new version, an error occurs, and I'm unable to identify the cause of the error even when launching the application using the command prompt or using the --inspect flag. And also will corrupt my my exe file so I can open the old version I have to reinstall it again from the installer

Please help me diagnose and resolve this issue.

my quit and install code

Logs :

20:17:16.189 > Found version 1.5.20 (url: ---.exe)
20:17:21.203 > Downloading update from ---.exe
20:17:21.205 > updater cache dir: C:\Users\---\---\myApp-updater
20:17:21.210 > disableWebInstaller is set to false, you should set it to true if you do not plan on using a web installer. This will default to true in a future version.
20:17:21.213 > Download block maps (old: "blockmap", new: blockmap)
20:17:21.905 > x49Tc7GXT1FsdkzenAsGBsNP duplicated in blockmap (same size), it doesn't lead to broken differential downloader, just corresponding block will be skipped)
20:17:21.911 > [
  {
    "kind": 0,
    "start": 0,
    "end": 39030793
  },
  {
    "kind": 0,
    "start": 38819109,
    "end": 38829646
  },
  {
    "kind": 0,
    "start": 39041330,
    "end": 100473449
  }
]
20:17:21.930 > Full: 98,118.6 KB, To download: 0 KB (0%)
20:17:21.937 > Differential download: `downloadLink`
20:17:26.442 > Cannot download differentially, fallback to full download: Error: sha512 checksum mismatch, expected v2bqek8ZcvRf0ss5KIWVA2ezcBvhjaeO+Qtz5RM24Ocd/YkdVG6wbod4d02Dp8esskzKWnpd56YOo/WpeaMG9A==, got tQiK0vZDeXF9nnr2YRDC7nauKssjAU/Sz9901gYM5lafLGtNDfcdpmFMmAlFEec7z2fxxPh2mtEI9jVgkYrrwg==

    at Object.newError (C:\Users\---\---\node_modules\builder-util-runtime\out\index.js:47:19)
    at g.validate 
    at WriteStream.<anonymous> (C:\Users\---\---\webpack:\node_modules\electron-updater\out\differentialDownloader\DifferentialDownloader.js:133:41)
    at WriteStream.emit (node:events:513:28)
    at WriteStream.emit (node:domain:489:12)
    at emitCloseNT (node:internal/streams/destroy:132:10)
    at processTicksAndRejections (node:internal/process/task_queues:81:21)
20:17:38.598 > New version 1.5.20 has been downloaded to C:\Users\---\AppData\Local\myApp-updater\pending\myApp.exe
20:17:43.689 > Install on explicit quitAndInstall
20:17:43.691 > Install: isSilent: false, isForceRunAfter: true
20:17:44.641 > Update installer has already been triggered. Quitting application.

    autoUpdater.on('update-downloaded', () => {
      this.updateDownloadedDoNotCheckUpdate = true;
      EventsHandler.mainWindow?.webContents.send('manage_update', {
        message: 'update-downloaded',
        title: 'Update downloaded',
        description: `Restarting App to Deploy Updates..`,
      });
      autoUpdater.quitAndInstall();
    });
ff-marco-pereira commented 1 year ago

Same here

catshanshan commented 10 months ago

Same

ismoil793 commented 10 months ago

Please let me know if you find a solution to this problem

I also created a similar question in stackoverflow

I am using

    "electron": "23.1.0",
    "electron-builder": "23.6.0",
    "electron-updater": "^4.3.9",

https://stackoverflow.com/questions/77748400/electron-based-app-flagged-as-potentially-unwanted-software-by-windows-defender

traktechio-jomaramomas commented 6 months ago

Having similar issue.

maoryadin commented 5 months ago

it is look like your sha512 is incorrect, can you validate the latest.yml file is having the expected sha? @Taha-daboussi