summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOdd Stranne <odd@mullvad.net>2018-11-02 09:26:12 +0100
committerOdd Stranne <odd@mullvad.net>2018-11-02 09:27:37 +0100
commit0f4e1d677e262843f56cf9e07553e0fb96b0c152 (patch)
treef4270fe975c6ff504e012024afdd1139caf7f678
parent3cd771f55f8630a4ff93669955c28b0757e9a254 (diff)
downloadmullvadvpn-0f4e1d677e262843f56cf9e07553e0fb96b0c152.tar.xz
mullvadvpn-0f4e1d677e262843f56cf9e07553e0fb96b0c152.zip
Migrate registry data during installation
-rw-r--r--dist-assets/windows/installer.nsh31
1 files changed, 31 insertions, 0 deletions
diff --git a/dist-assets/windows/installer.nsh b/dist-assets/windows/installer.nsh
index 64b38528e0..1de27c2b14 100644
--- a/dist-assets/windows/installer.nsh
+++ b/dist-assets/windows/installer.nsh
@@ -305,6 +305,37 @@
!define RemoveSettings '!insertmacro "RemoveSettings"'
#
+# customInit
+#
+# This macro is activated right when the installer first starts up.
+#
+# When the installer is starting, take the opportunity to update registry
+# keys to use the new app identifier.
+#
+# This enables subsequent logic in the installer to correctly identify
+# that there is a previous version of the app installed.
+#
+!macro customInit
+
+ Push $0
+
+ registry::MoveKey "HKLM\SOFTWARE\8fa2c331-e09e-5709-bc74-c59df61f0c7e" "HKLM\SOFTWARE\Mullvad VPN"
+
+ # Discard return value
+ Pop $0
+ Pop $0
+
+ registry::MoveKey "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\8fa2c331-e09e-5709-bc74-c59df61f0c7e" "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mullvad VPN"
+
+ # Discard return value
+ Pop $0
+ Pop $0
+
+ Pop $0
+
+!macroend
+
+#
# customInstall
#
# This macro is activated towards the end of the installation