[ekiga/gnome-2-26] [windows] Better check the installation directory during install



commit 71ecb6d1c96075ffc9b98e21412b32c28dc9d779
Author: Eugen Dedu <Eugen Dedu pu-pm univ-fcomte fr>
Date:   Sun May 9 18:31:40 2010 +0200

    [windows] Better check the installation directory during install

 win32/nsisinstaller/ekiga.nsi |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/win32/nsisinstaller/ekiga.nsi b/win32/nsisinstaller/ekiga.nsi
index 344c677..ccaf3d4 100644
--- a/win32/nsisinstaller/ekiga.nsi
+++ b/win32/nsisinstaller/ekiga.nsi
@@ -285,13 +285,23 @@ SectionEnd ; end of GTK+ section
 Section $(EKIGA_SECTION_TITLE) SecEkiga
   SectionIn 1 RO
 
+  ; find out a good installation directory, allowing the uninstaller
+  ;   to safely remove the whole installation directory
+  ; if INSTDIR does not end in [Ee]kiga, then add subdir Ekiga
+  ${GetFileName} $INSTDIR $R0
+  StrCmp $R0 ekiga nameok 0  ; unsensitive comparation
+  StrCpy $INSTDIR "$INSTDIR\Ekiga"
+
+  nameok:
+  ; if exists and not empty, then add subdir Ekiga
   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)
+  ${DirState} $INSTDIR $R0
+  IntCmp $R0 0 dirok
   StrCpy $INSTDIR "$INSTDIR\Ekiga"
-  ; if this sub-directory exists too, then abort the installation
+
+  ; if exists, abort
   IfFileExists $INSTDIR 0 dirok
-  abort "Error: $INSTDIR already exists.  Please restart the setup and specify another installation directory"
+  abort "Error: tried $INSTDIR, but it already exists.  Please restart the setup and specify another installation directory"
 
   dirok:
   ; Check install rights..



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