commit 97c89c86a10537e60b52a1859e703629016562c9
Author: Uwe Stöhr <uwesto...@lyx.org>
Date:   Sun Mar 30 05:33:55 2014 +0200

    installer: fix a bug with file associations
    
    - this fixes the bug I mentioned in my previous installer commit

diff --git a/development/Win32/packaging/installer/include/declarations.nsh 
b/development/Win32/packaging/installer/include/declarations.nsh
index 797ac6e..d7fa432 100644
--- a/development/Win32/packaging/installer/include/declarations.nsh
+++ b/development/Win32/packaging/installer/include/declarations.nsh
@@ -56,9 +56,10 @@ Configuration of LyX installer
 !define APP_WEBPAGE_INFO "${APP_NAME} Website"
 !define APP_WIKI "http://wiki.lyx.org";
 !define APP_WIKI_INFO "${APP_NAME} Wiki"
-!define APP_COPYRIGHT "LyX is Copyright � 1995 by Matthias Ettrich, 1995-2012 
by the LyX Team"
+!define APP_COPYRIGHT "LyX is Copyright � 1995 by Matthias Ettrich, 1995-2014 
by the LyX Team"
 
 !define APP_RUN "bin\lyx.exe"
+!define BIN_LYX "lyx.exe"
 
 !define APP_REGKEY "Software\${APP_NAME}${APP_SERIES_KEY}" # like "LyX200"
 !define APP_REGKEY_SETUP "${APP_REGKEY}\Setup"
@@ -95,7 +96,7 @@ Configuration of LyX installer
 !define SETUP_UNINSTALLER_KEY "${APP_NAME}${APP_SERIES_KEY}"
 
 #--------------------------------
-# Names of binaries to identify compontents
+# Names of binaries to identify components
 
 !define BIN_LATEX "latex.exe"
 !define BIN_BIBTEXEDITOR "JabRef.exe"
diff --git a/development/Win32/packaging/installer/setup/configure.nsh 
b/development/Win32/packaging/installer/setup/configure.nsh
index 406aeb6..9e6d18b 100644
--- a/development/Win32/packaging/installer/setup/configure.nsh
+++ b/development/Win32/packaging/installer/setup/configure.nsh
@@ -83,6 +83,13 @@ Section -Configure
    WriteRegStr SHCTX "Software\Classes\${APP_REGNAME_DOC}" "" "${APP_NAME} 
Document"
    WriteRegStr SHCTX "Software\Classes\${APP_REGNAME_DOC}\DefaultIcon" "" 
"$INSTDIR\${APP_RUN},0"
    WriteRegStr SHCTX "Software\Classes\${APP_REGNAME_DOC}\Shell\open\command" 
"" '"$INSTDIR\${APP_RUN}" "%1"'
+   # we need to update also the automatically created entry about the lyx.exe
+   # otherwise .lyx-files will could be opened with an older LyX version
+   ReadRegStr $0 SHCTX 
"Software\Classes\Applications\${BIN_LYX}\shell\open\command" ""
+   ${if} $0 != "" # if something was found
+    WriteRegStr SHCTX 
"Software\Classes\Applications\${BIN_LYX}\shell\open\command" "" 
'"$INSTDIR\${APP_RUN}" "%1"'
+   ${endif}
+   # .lyx
    WriteRegStr SHCTX "Software\Classes\${APP_EXT}" "" "${APP_REGNAME_DOC}"
    WriteRegStr SHCTX "Software\Classes\${APP_EXT}" "Content Type" 
"${APP_MIME_TYPE}"
    # .lyx13

Reply via email to