commit 00f8bfcae56783de79611dcaddda009bd0463aac
Author: Uwe Stöhr <[email protected]>
Date:   Sun Mar 9 07:57:47 2014 +0100

    installer: fix potential serious bug

diff --git a/development/Win32/packaging/installer/ChangeLog.txt 
b/development/Win32/packaging/installer/ChangeLog.txt
index 66d1339..fc21866 100644
--- a/development/Win32/packaging/installer/ChangeLog.txt
+++ b/development/Win32/packaging/installer/ChangeLog.txt
@@ -1,4 +1,9 @@
-Changelog for LyX-207-2:
+Changelog for LyX-207-3:
+- fix serious bug that LyX could directly be installed to c:\programs
+  the uninstaller would then delete the whole c:\programs folder
+
+
+Changelog for LyX-207-2:
 - LyX can now be installed and uninstalled silently
   (administrators can start the installer with "LyX-207-Installer-2.exe /S")
 - updated to Python 2.7.6
diff --git a/development/Win32/packaging/installer/setup/install.nsh 
b/development/Win32/packaging/installer/setup/install.nsh
index 262fec5..b34b52a 100644
--- a/development/Win32/packaging/installer/setup/install.nsh
+++ b/development/Win32/packaging/installer/setup/install.nsh
@@ -14,6 +14,16 @@ Var PythonCompileReturn
 
 Section -ProgramFiles SecProgramFiles
 
+  # if the $INSTDIR does not contain "LyX" we must add a subfolder to avoid 
that LyX will e.g.
+  # be installed directly to C:\programs - the uninstaller will then delete 
the whole
+  # C:\programs directory
+  StrCpy $String $INSTDIR
+  StrCpy $Search "LyX"
+  Call StrPoint # function from LyXUtils.nsh
+  ${if} $Pointer == "-1"
+   StrCpy $INSTDIR "$INSTDIR\${APP_DIR}"
+  ${endif}
+
  !if ${SETUPTYPE} != BUNDLE
   # abort the installation if no LaTeX was found but should be used
   ${if} $PathLaTeX == ""

Reply via email to