tauri-apps / tauri

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

[feat] Can provide an "afterBundleCommand" hook function? #9767

Open muwoo opened 2 months ago

muwoo commented 2 months ago

Describe the problem

Sometimes, I need to run some custom scripts after building the installer application ({appname}-setup.exe) and before generating the update package(such as setup.nsis.zip or setup.nsis.zip.sign).

This is because I need to manually sign the {appname}-setup.exe file, and without this afterBundleCommand hook, I won't be able to complete this before generating the update package.

Describe the solution you'd like

Can you provide a hook "afterBundleCommand" to execute after the installer application is generated?

Alternatively, are there any alternative solutions?

Thanks alot!

Additional context

No response

amrbashir commented 2 months ago

how and why do you need to manually sign installer? if you have setup the signing configurations correctly, we sign the installer for you.

muwoo commented 2 months ago

@amrbashir Thank you very much for your reply!

I configured it correctly, and I see that tauri will sign the packaged exe application, but I still need to sign the generated NSIS setup.exe installation package.

But I'm not sure if Tauri will continue to sign this setup.exe. If it can be signed, then I don't need this requirement, if not, then I want to be able to customize the script to continue signing setup.exe after the bundle produces setup.exe.

amrbashir commented 2 months ago

It does sign the -setup.exe file, can you show the ouput of tauiri build --verbose

muwoo commented 2 months ago

It does sign the -setup.exe file, can you show the ouput of tauiri build --verbose

I know, thank you very much for your reply, but I still wish Tauri could add more hooks to the build process, similar to Electron, so the developer's freedom would be much better. For example, in electron-builder, we can set these hooks:

beforePack
afterPack
afterSign
afterAllArtifactBuild
onNodeModuleFile
AfterPackContext
BuildResult