GNOME GIT source code repository

summaryrefslogtreecommitdiff
authorEugen Dedu <Eugen.Dedu@pu-pm.univ-fcomte.fr>2010-05-08 11:59:14 (GMT)
committer Eugen Dedu <Eugen.Dedu@pu-pm.univ-fcomte.fr>2010-05-08 12:20:41 (GMT)
commit138ea339bb09c78714dbe54deb23b24606a87296 (patch) (side-by-side diff)
treedcd406999ab5d96e84a25927e5cd25e3d3029a6c
parent2bf68027d09edb337907a20859fa8539b2aa2495 (diff)
[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.
-rw-r--r--win32/nsisinstaller/ekiga.nsi22
1 files changed, 10 insertions, 12 deletions
diff --git a/win32/nsisinstaller/ekiga.nsi b/win32/nsisinstaller/ekiga.nsi
index e751909..516f9e8 100644
--- a/win32/nsisinstaller/ekiga.nsi
+++ b/win32/nsisinstaller/ekiga.nsi
@@ -284,6 +284,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
@@ -430,12 +439,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"
@@ -445,12 +449,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"