diff options
| author | Odd Stranne <odd@mullvad.net> | 2018-08-16 22:08:52 +0200 |
|---|---|---|
| committer | Odd Stranne <odd@mullvad.net> | 2018-08-29 12:14:24 +0200 |
| commit | a427a9d6948041a8877b46382fdec8f326b21101 (patch) | |
| tree | 341905897819e7c282a924fae0622965348edb1a | |
| parent | e0fbb5dfda63ebb054a47aaf88a270ab1334a68a (diff) | |
| download | mullvadvpn-a427a9d6948041a8877b46382fdec8f326b21101.tar.xz mullvadvpn-a427a9d6948041a8877b46382fdec8f326b21101.zip | |
Update uninstaller script with better system cleaning
| -rw-r--r-- | dist-assets/windows/installer.nsh | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/dist-assets/windows/installer.nsh b/dist-assets/windows/installer.nsh index b421a61fbe..675aae28f3 100644 --- a/dist-assets/windows/installer.nsh +++ b/dist-assets/windows/installer.nsh @@ -231,6 +231,48 @@ !define InstallService '!insertmacro "InstallService"' # +# RemoveLogsAndCache +# +# Call into helper DLL instructing it to remove all logs and cache +# for the current user, other regular users and the SYSTEM (service) user. +# +!macro RemoveLogsAndCache + + Push $0 + + cleanup::RemoveLogsAndCache + + # Discard return value + Pop $0 + + Pop $0 + +!macroend + +!define RemoveLogsAndCache '!insertmacro "RemoveLogsAndCache"' + +# +# RemoveSettings +# +# Call into helper DLL instructing it to remove all settings +# for the current user, other regular users and the SYSTEM (service) user. +# +!macro RemoveSettings + + Push $0 + + cleanup::RemoveSettings + + # Discard return value + Pop $0 + + Pop $0 + +!macroend + +!define RemoveSettings '!insertmacro "RemoveSettings"' + +# # customInstall # # This macro is activated towards the end of the installation @@ -286,6 +328,7 @@ !macro customRemoveFiles Push $0 + Push $1 nsExec::ExecToStack '"sc.exe" stop mullvadvpn' @@ -303,7 +346,20 @@ # Original removal functionality provided by Electron-builder RMDir /r $INSTDIR - + + # Check command line arguments + ${GetParameters} $0 + ${GetOptions} $0 "/S" $1 + + # If not ran silently + ${If} ${Errors} + ${RemoveLogsAndCache} + MessageBox MB_ICONQUESTION|MB_YESNO "Would you like to remove settings files as well?" IDNO customRemoveFiles_after_remove_settings + ${RemoveSettings} + customRemoveFiles_after_remove_settings: + ${EndIf} + + Pop $1 Pop $0 !macroend |
