let the installer uninstall previous beta installations of libCEC Tray, and remove...
authorLars Op den Kamp <lars@opdenkamp.eu>
Sat, 6 Oct 2012 09:28:42 +0000 (11:28 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Sat, 6 Oct 2012 10:46:16 +0000 (12:46 +0200)
project/libCEC.nsi

index 61cff60b28c9fbd5aaa0621b75d0ac845a6e8b1d..514840673440a763c065970fdffd0cfabef1b1ce 100644 (file)
@@ -172,10 +172,29 @@ Section "CEC debug client" SecCecClient
     
 SectionEnd
 
-Section "libCEC Tray" SecCecConfig
+Section "libCEC Tray Application" SecCecTray
   SetShellVarContext current
   SectionIn 1 3
 
+  ; Uninstall previous beta builds of the tray application
+  ReadRegStr $1 HKLM "Software\Pulse-Eight\libCECTray" ""
+  ${If} $1 != ""
+    MessageBox MB_OK \
+         "A previous beta build of the libCEC Tray Application was found. Press OK to uninstall the old version. Do not uninstall the driver when asked to. Thank you for participating in the beta test."
+    ExecWait '"$1\Uninstall.exe" /S _?=$1'
+       Delete "$1\Uninstall.exe"
+  ${EndIf}
+
+  ; Replace cec-config-gui.exe
+  Delete "$INSTDIR\cec-config-gui.exe"
+  ${If} ${RunningX64}
+    Delete "$INSTDIR\x64\cec-config-gui.exe"
+  ${EndIf}
+  Delete "$SMPROGRAMS\$StartMenuFolder\CEC Adapter Configuration.lnk"
+  ${If} ${RunningX64}
+    Delete "$SMPROGRAMS\$StartMenuFolder\CEC Adapter Configuration (x64).lnk"
+  ${EndIf}
+
   ; Copy to the installation directory
   SetOutPath "$INSTDIR"
   File "..\build\cec-tray.exe"