evshiron / nwjs-builder-phoenix

MIT License
288 stars 78 forks source link

NSIS Target and Updater #7

Open evshiron opened 7 years ago

evshiron commented 7 years ago
evshiron commented 7 years ago

NSIS is zlib/libpng licensed, so it should be safe to include in this repo.

Writing NSIS scripts seems painful, and I should firstly give NSIS Quick Setup Script Generator a try.

evshiron commented 7 years ago

At the moment, we should be able to generate diff scripts from two directories. Here comes the question, how should nwjs-builder-phoenix be able to know which versions to diff with?

I'm thinking of maintaining a versions.nsis.json in the output directory. It collects version, filename, sha256 and which the latest version is (and possibly update channels?), which can be easily used as a manifest file for an update server.

evshiron commented 7 years ago

Hmm. I am going to bundle Modern UI 2 for simple installer building, and thinking about ways to support custom scripts.

evshiron commented 7 years ago

I am considering using mechanisms like what electron-builder does, it does provide faster and better compression.

BTW concurrent building might also be considered, as every Builder.buildTask should not interfere as far as I know. The problem is, every task is printing states independently, also the progress bar, which altogether result in a mess in stdout, as a result this feature might require further efforts.

evshiron commented 7 years ago

Integration of nsis7z has greatly reduced building time to around 2/3 (from 150 seconds to 100 seconds).

fritx commented 7 years ago

Hi there, how could I call just buildNsisTarget against a provided directory? I need to integrate this feature into my current project, and we already have a packed dir, just want to do the nsis thing automatically.

evshiron commented 7 years ago

See /test/nsis-gen/. You can require('nwjs-builder-phoenix/dist/lib/nsis-gen') and use it directly.

We use one of NsisComposer, Nsis7Zipper and NsisDiffer to generate scripts, and call nsisBuild to create installers.

fritx commented 7 years ago

@evshiron yeah I see, it works, thanks.