diff --git a/share/windows/KPXC_ExitDlg.wxs b/share/windows/KPXC_ExitDlg.wxs
index 0ed4d3e8..ac4a802e 100644
--- a/share/windows/KPXC_ExitDlg.wxs
+++ b/share/windows/KPXC_ExitDlg.wxs
@@ -15,7 +15,7 @@
- NOT Installed
+ NOT Installed OR WIX_UPGRADE_DETECTED
diff --git a/share/windows/wix-template.xml b/share/windows/wix-template.xml
index 918fe64e..173a1155 100644
--- a/share/windows/wix-template.xml
+++ b/share/windows/wix-template.xml
@@ -57,16 +57,24 @@
-
+
@@ -80,33 +88,46 @@
Name="KeePassXC"
Target="[#CM_FP_KeePassXC.exe]"
WorkingDirectory="INSTALL_ROOT" />
+
-
+
+
+
+
+
+
+
+
+
+
+ AUTOSTARTPROGRAM="0" OR (WIX_UPGRADE_DETECTED AND NOT AUTOSTARTPROGRAM_REGISTRY)
+ WIX_UPGRADE_DETECTED AND INSTALLDESKTOPSHORTCUT_REGISTRY
+ WIX_UPGRADE_DETECTED
-
+
+
-
+
+
-
-
-
-
+
+