electron-builder icon indicating copy to clipboard operation
electron-builder copied to clipboard

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

Open universeroc opened this issue 1 month ago • 0 comments

  • Electron-Builder Version: v24.13.3
  • Node Version: v18.17.0
  • Electron Version: 27.1.2
  • Electron Type (current, beta, nightly):

6.2.1

  • Target:

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

universeroc avatar Jun 05 '24 12:06 universeroc