[vlc-devel] [PATCH] NSIS: Add ability to skip the other bitness uninstall

Marvin Scholz epirat07 at gmail.com
Tue Jan 23 19:22:59 CET 2018


---
 extras/package/win32/NSIS/vlc.win32.nsi.in | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/extras/package/win32/NSIS/vlc.win32.nsi.in b/extras/package/win32/NSIS/vlc.win32.nsi.in
index d1d446c18d..4b28d1aad3 100644
--- a/extras/package/win32/NSIS/vlc.win32.nsi.in
+++ b/extras/package/win32/NSIS/vlc.win32.nsi.in
@@ -572,8 +572,23 @@ WinOk:
 
   ${If} $PreviousVersion != ""
     ; Uninstall the other bitness bit version!
-    MessageBox MB_OK|MB_ICONSTOP "An ${OTHER_BITNESS}bit version of VLC was detected, it must be uninstalled first!"
-
+    MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \
+    "An ${OTHER_BITNESS}bit version of VLC was detected, it should be uninstalled first! \
+    Do you want to uninstall it?" \
+    IDYES uninstall_other_bitness \
+    IDCANCEL uninstall_other_bitness_canceld
+
+  ; If the lines below are reached, the user denied to uninstall the other bitness VLC, ask if she is shure
+  MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION|MB_DEFBUTTON2 \
+    "Keeping the other version of VLC and installing this one can lead to unexpected scenarios.$\n\
+    Note that you will not get different entries in the start menu or different desktop icons. \
+    The Windows App list will only show one VLC and uninstalling both can be tricky." \
+    IDOK no_uninstall_other_bitness
+
+uninstall_other_bitness_canceld:
+  Quit
+
+uninstall_other_bitness:
     SetRegView ${OTHER_BITNESS}
     ReadRegStr $R1 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString"
     ReadRegStr $R2 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallLocation"
@@ -603,6 +618,9 @@ WinOk:
     StrCpy $PreviousVersion ""
   ${EndIf}
 
+no_uninstall_other_bitness:
+  ; In this cases the user has chosen to intentionally install both 32 and 64 bit
+
 
   ; See if previous version exists
   Call ReadPreviousVersion
-- 
2.14.3 (Apple Git-98)



More information about the vlc-devel mailing list