tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
78.1k stars 2.31k forks source link

[feat][v2] nsis: provide customization for default installer.nsi #9668

Open pronebird opened 1 week ago

pronebird commented 1 week ago

Describe the problem

Hi,

Currently I need to bundle a few workspace binaries with my app and execute a few custom commands during installation, at the following stages:

This is impossible without copying a rather complex 800 LOC installer.nsi template from tauri and modifying it. However this crates a situation where I have to keep my custom installer script up to date and synchronize changes to the default template (i.e perhaps improvements and bug fixes). Since the file is large enough, this creates a lot of hurdle.

Describe the solution you'd like

I think it would be reasonable to have extend NSIS configuration and alternatively provide NSIS scripts injected into the installer.nsi template. As I described above I think having three different phases is ok, i.e:

I think a reasonable way to handle this would be to provide the installer with a single installer-hooks.nsh (optional) that can be injected into installer.nsi. The hooks script could expose three functions (or macro?) that will be called at different stages of installer lifecycle.

Alternatives considered

No response

Additional context

No response