From 86d2234713f7361e4781cefe4517ac16f951bb9b Mon Sep 17 00:00:00 2001 From: huzibaca Date: Tue, 22 Oct 2024 04:46:08 +0800 Subject: [PATCH] feat: add windows uninstall script --- packages/windows/nsis_hooks.sh | 5 +++++ src-tauri/tauri.windows.conf.json | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 packages/windows/nsis_hooks.sh diff --git a/packages/windows/nsis_hooks.sh b/packages/windows/nsis_hooks.sh new file mode 100644 index 00000000..2cd2df9a --- /dev/null +++ b/packages/windows/nsis_hooks.sh @@ -0,0 +1,5 @@ +!define NSIS_HOOK_PREUNINSTALL "NSIS_HOOK_PREUNINSTALL_" + +!macro NSIS_HOOK_PREUNINSTALL_ +ExecWait '"$INSTDIR\uninstall-service.exe"' +!macroend diff --git a/src-tauri/tauri.windows.conf.json b/src-tauri/tauri.windows.conf.json index 84047f1b..bf46ee2d 100644 --- a/src-tauri/tauri.windows.conf.json +++ b/src-tauri/tauri.windows.conf.json @@ -16,7 +16,8 @@ "installerIcon": "icons/icon.ico", "languages": ["SimpChinese", "English"], "installMode": "perMachine", - "template": "./template/installer.nsi" + "template": "./template/installer.nsi", + "installerHooks": "../packages/windows/nsis_hooks.sh" } } },