From 2383abb4968abdafc717e2a867b101bc38c12be6 Mon Sep 17 00:00:00 2001 From: Christoph Brandau Date: Wed, 8 Jul 2026 19:52:59 +0200 Subject: [PATCH] feat(tauri): add NSIS hooks for post-install and post-uninstall This update introduces NSIS hooks for managing shortcuts and directories during the installation and uninstallation of the application. The hooks ensure that the desktop and start menu shortcuts are removed properly, along with the associated program directory. - Implement post-install and post-uninstall hooks in NSIS - Update configuration to reference the new hooks file --- src-tauri/nsis-hooks.nsh | 11 +++++++++++ src-tauri/tauri.conf.json | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 src-tauri/nsis-hooks.nsh diff --git a/src-tauri/nsis-hooks.nsh b/src-tauri/nsis-hooks.nsh new file mode 100644 index 0000000..f085d6b --- /dev/null +++ b/src-tauri/nsis-hooks.nsh @@ -0,0 +1,11 @@ +!macro NSIS_HOOK_POSTINSTALL + Delete "$DESKTOP\GitLite.lnk" + Delete "$SMPROGRAMS\GitLite.lnk" + RMDir /r "$SMPROGRAMS\GitLite" +!macroend + +!macro NSIS_HOOK_POSTUNINSTALL + Delete "$DESKTOP\GitLite.lnk" + Delete "$SMPROGRAMS\GitLite.lnk" + RMDir /r "$SMPROGRAMS\GitLite" +!macroend diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index d0d1b7a..0e4f340 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -55,7 +55,8 @@ "windows": { "nsis": { "installMode": "currentUser", - "installerIcon": "icons/icon.ico" + "installerIcon": "icons/icon.ico", + "installerHooks": "nsis-hooks.nsh" } } },