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.46k stars 1.71k forks source link

Differential update fail with full customized installer nsis script install.nsi #8247

Open universeroc opened 4 weeks ago

universeroc commented 4 weeks ago

I have to use

build: {
  script: "installer.nsi"
}

to implement full customized installation requirements.

After I finished transplant my nsis script into electron-builder's installer.nsi and I used electron-updater to do a differential update check, it fails with this error:

htttp 400 bad request

I added some console.log directly in NsisTarget.js from app-builder-lib/out to checkout why but failed.

I've spent about 1 week to find the very reason but I don't figure it out. Here's all what I've done during these days.

  1. compare all build configure differences from good to bad
  2. compare with script: installer.nsi and without
  3. compare a sample install.nsi with electron-builder's template installer.nsi
  4. compare package app-name-arch.nsis.7z and without

this is what I find:

with only one Section "install" same as electron-builder's nsis template, if I use APP_BUILD_DIR which means do not use 7z compress, it works but when I use File app-name-arch.nsis.7z and even the same code copied from electron-builder's nsis template extractEmbededApp, it does not work, I will get the 400 bad request error when I check update with differential update.

I have tried SetSectionSize and also any other necessary code before install but can not figure out the very reason.

Also I tried the alpha version to see whether it's a bug and fixed in the future version, it does not work even :(

The plan B which I am doing is include: 'installer.nsh' any other extra customization of nsis through overwriting the origianl nsis nsh or nsi template to implement. It's a bad way to go but I have suffered it too long.

Please help me out, thanks in advance 👍

The electron-builder's nsis template works if I don't use any installer.nsi