From 4a8c64067dd21cb929bd7ea11e852bce1599e8b5 Mon Sep 17 00:00:00 2001 From: Alexandr Stelnykovych Date: Thu, 27 Mar 2025 15:13:05 +0200 Subject: [PATCH] [desktop] Windows uninstaller fixes --- .../templates/nsis/install_hooks.nsh | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/desktop/tauri/src-tauri/templates/nsis/install_hooks.nsh b/desktop/tauri/src-tauri/templates/nsis/install_hooks.nsh index 4d9c600b..15f10fd7 100644 --- a/desktop/tauri/src-tauri/templates/nsis/install_hooks.nsh +++ b/desktop/tauri/src-tauri/templates/nsis/install_hooks.nsh @@ -116,7 +116,7 @@ var dataDir RMDir /r "$oldInstallationDir\intel" ; Delete the link to the ProgramData folder - RMDir /r "$PROGRAMFILES\Safing" + RMDir /r "$PROGRAMFILES64\Safing" ; Delete v1 user shortcut if its there. SetShellVarContext current @@ -158,7 +158,7 @@ var dataDir ; Post-uninstall hook: ; - Delete files !macro NSIS_HOOK_POSTUNINSTALL - ; Delete binarys + ; Delete binaries Delete /REBOOTOK "$INSTDIR\index.json" Delete /REBOOTOK "$INSTDIR\portmaster-core.exe" Delete /REBOOTOK "$INSTDIR\portmaster-kext.sys" @@ -168,25 +168,22 @@ var dataDir Delete /REBOOTOK "$INSTDIR\assets.zip" RMDir /r /REBOOTOK "$INSTDIR" - ; Delete Tauri leftovers - RMDir /r /REBOOTOK "$APPDATA\Portmaster" - - ; Delete intel data - Delete /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\intel\index.json" - Delete /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\intel\base.dsdl" - Delete /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\intel\geoipv4.mmdb" - Delete /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\intel\geoipv6.mmdb" - Delete /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\intel\index.dsd" - Delete /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\intel\intermediate.dsdl" - Delete /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\intel\urgent.dsdl" - Delete /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\intel\main-intel.yaml" - Delete /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\intel\notifications.yaml" - Delete /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\intel\news.yaml" + ; delete data files + Delete /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\databases\history.db" + RMDir /r /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\databases\cache" + RMDir /r /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\databases\icons" RMDir /r /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\intel" + RMDir /r /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\download_intel" + RMDir /r /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\download_binaries" + RMDir /r /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\exec" + RMDir /r /REBOOTOK "$COMMONPROGRAMDATA\Portmaster\logs" ${If} $DeleteAppDataCheckboxState = 1 + DetailPrint "Deleting the application data..." RMDir /r /REBOOTOK "$COMMONPROGRAMDATA\Portmaster" RMDir /r /REBOOTOK "$COMMONPROGRAMDATA\Safing" + ${Else} + DetailPrint "Application data kept as requested by the user." ${EndIf} !macroend \ No newline at end of file