[ekiga/gnome-2-26] [windows] Fix major bug where the uninstaller removes non-Ekiga files



commit 2d1d493c126d76c0709051fb3104d6f261c0acb4
Author: Eugen Dedu <Eugen Dedu pu-pm univ-fcomte fr>
Date:   Sat May 8 13:59:14 2010 +0200

    [windows] Fix major bug where the uninstaller removes non-Ekiga files
    
    This case appeared when Ekiga is installed in a non-empty directory,
    because the uninstaller removes the whole install directory, hence
    other files too.
    
    The simplest solution I found is that if the installation directory is
    not empty (such as MyDocs), then it is installed into an empty
    sub-directory.  Thus, even when the uninstall removes the whole
    sub-directory, there is no problem.

 win32/nsisinstaller/ekiga.nsi |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/win32/nsisinstaller/ekiga.nsi b/win32/nsisinstaller/ekiga.nsi
index fad7b0d..344c677 100644
--- a/win32/nsisinstaller/ekiga.nsi
+++ b/win32/nsisinstaller/ekiga.nsi
@@ -285,6 +285,15 @@ SectionEnd ; end of GTK+ section
 Section $(EKIGA_SECTION_TITLE) SecEkiga
   SectionIn 1 RO
 
+  IfFileExists $INSTDIR 0 dirok
+  ; if install directory already exists, install in Ekiga sub-directory instead
+  ; (this is needed upon uninstallation, since the whole install dir is removed)
+  StrCpy $INSTDIR "$INSTDIR\Ekiga"
+  ; if this sub-directory exists too, then abort the installation
+  IfFileExists $INSTDIR 0 dirok
+  abort "Error: $INSTDIR already exists.  Please restart the setup and specify another installation directory"
+
+  dirok:
   ; Check install rights..
   Call CheckUserInstallRights
   Pop $R0
@@ -431,12 +440,7 @@ Section Uninstall
     ; Remove Language preference info
     DeleteRegKey HKCU ${EKIGA_REG_KEY} ;${MUI_LANGDLL_REGISTRY_ROOT} ${MUI_LANGDLL_REGISTRY_KEY}
 
-
-    RMDir "$INSTDIR\pixmaps"
-    RMDir "$INSTDIR\ekiga"
-    RMDir "$INSTDIR\sounds"
-    RMDir "$INSTDIR\locale"
-    Delete /REBOOTOK "$INSTDIR\*.*"
+    ; this is safe, since Ekiga was installed in an empty directory
     RMDir /r /REBOOTOK "$INSTDIR"
 
     SetShellVarContext "all"
@@ -446,12 +450,6 @@ Section Uninstall
     Delete "$DESKTOP\Ekiga.lnk"
 
     SetShellVarContext "current"
-
-    Delete "$INSTDIR\${EKIGA_UNINST_EXE}"
-
-    ;Try to remove Ekiga install dir .. if empty
-    RMDir "$INSTDIR"
-
     ; Shortcuts..
     RMDir /r "$SMPROGRAMS\Ekiga"
     Delete "$DESKTOP\Ekiga.lnk"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]