]> git.lyx.org Git - lyx.git/commitdiff
installer: bugfixes, code simplification and documentation
authorUwe Stöhr <uwestoehr@lyx.org>
Sun, 11 Nov 2012 17:07:55 +0000 (18:07 +0100)
committerUwe Stöhr <uwestoehr@lyx.org>
Sun, 11 Nov 2012 17:07:55 +0000 (18:07 +0100)
- dictionaries.nsh: code documentation and simplification
- lyx.nsi: comment out currently unused code
- init.nsh: some corrections and fix bug that info that JabRef and MiKTeX were installed together with LyX was deleted before the uninstaller was really run
- LaTeX.nsh: documentation and fix a bug (for an unknown reason SHCTX can be used to read and delte but not to write in the registry)
- gui.nsh: enable descriptions
- detection: move dictionary code to dictionaries

14 files changed:
development/Win32/packaging/installer/include/LaTeX.nsh
development/Win32/packaging/installer/include/detection.nsh
development/Win32/packaging/installer/include/dictionaries.nsh [new file with mode: 0644]
development/Win32/packaging/installer/include/gui.nsh
development/Win32/packaging/installer/include/init.nsh
development/Win32/packaging/installer/include/nsis.nsh
development/Win32/packaging/installer/include/thesaurus.nsh [deleted file]
development/Win32/packaging/installer/lang/english.nsh
development/Win32/packaging/installer/lang/german.nsh
development/Win32/packaging/installer/lyx-bundle.nsi
development/Win32/packaging/installer/lyx-standard.nsi
development/Win32/packaging/installer/lyx.nsi
development/Win32/packaging/installer/setup/install.nsh
development/Win32/packaging/installer/setup/uninstall.nsh

index d1b0168192220b3af8cd24a7544c4e755692e9c5..d47dabcd7e2324d7463fdefef7f88b524c9c3f4f 100644 (file)
@@ -1,5 +1,28 @@
+/*
+LaTeX.nsh
+
+Handling of LaTeX distributions
+*/
+
+# This script contains the following functions:
+#
+# - LaTeXActions (checks if MiKTeX or TeXLive is installed)
+#
+# - InstallMiKTeX (installs MiKTeX if not already installed),
+#   only for bunlde installer, uses:
+#    LaTeXCheck # function from LyXUtils.nsh
+#
+# - ConfigureMiKTeX
+#   (installs the LaTeX class files that are delivered with LyX,
+#    a Perl interpreter for splitindex
+#    and enable MiKTeX's automatic package installation)
+#
+# - UpdateMiKTeX (asks to update MiKTeX)
+
+# ---------------------------------------
+
 Function LaTeXActions
- # check if MiKTeX or TeXLive is installed
+ # checks if MiKTeX or TeXLive is installed
 
   # test if MiKTeX is installed
   # reads the PATH variable via the registry because NSIS' "$%Path%" variable is not updated when the PATH changes
@@ -109,8 +132,8 @@ FunctionEnd
 !if ${SETUPTYPE} == BUNDLE
 
  Function InstallMiKTeX
+  # installs MiKTeX if not already installed
   
-  # install MiKTeX if not already installed
   ${if} $PathLaTeX == ""
    # launch MiKTeX's installer
    MessageBox MB_OK|MB_ICONINFORMATION "$(LatexInfo)"
@@ -130,7 +153,9 @@ FunctionEnd
    ${if} $PathLaTeX != ""
     # set package repository (MiKTeX's primary package repository)
     ${if} $MiKTeXUser == "HKCU"
-     WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX" "Yes${APP_SERIES_KEY}" # special entry to tell the uninstaller that it was installed with LyX
+     # special entry that it was installed together with LyX
+     # so that we can later uninstall it together with LyX
+     WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX" "Yes${APP_SERIES_KEY}"
     ${else}
      WriteRegStr HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX" "Yes${APP_SERIES_KEY}"
     ${endif}
@@ -214,14 +239,14 @@ Function ConfigureMiKTeX
   # enable package installation without asking (1 = Yes, 0 = No, 2 = Ask me first)
   WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "AutoInstall" "1" # if only for current user
   ${if} $MiKTeXUser != "HKCU"
-   WriteRegStr SHCTX "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "AutoInstall" "1"
+   WriteRegStr HKLM "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "AutoInstall" "1"
   ${endif}
   # set package repository (MiKTeX's primary package repository)
   WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "RemoteRepository" "${MiKTeXRepo}" # if only for current user
   WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "RepositoryType" "remote" # if only for current user
   ${if} $MiKTeXUser != "HKCU"
-   WriteRegStr SHCTX "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "RemoteRepository" "${MiKTeXRepo}"
-   WriteRegStr SHCTX "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "RepositoryType" "remote"
+   WriteRegStr HKLM "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "RemoteRepository" "${MiKTeXRepo}"
+   WriteRegStr HKLM "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "RepositoryType" "remote"
   ${endif}
   
   # enable MiKTeX's automatic package installation
@@ -234,7 +259,7 @@ Function ConfigureMiKTeX
 FunctionEnd
 
 Function UpdateMiKTeX
- # ask to update MiKTeX
+ # asks to update MiKTeX
 
   ${if} $LaTeXInstalled == "MiKTeX"
    MessageBox MB_YESNO|MB_ICONINFORMATION "$(MiKTeXInfo)" IDYES UpdateNow IDNO UpdateLater
index d0763026780d683883d5b4aa2d64750ccbf66c9c..a27e5bbf7864f8cb7f6926e5f608465584b119ee 100644 (file)
@@ -30,7 +30,7 @@ Detection of external component locations
 Function SearchExternal
   Call LaTeXActions # function from LaTeX.nsh
   Call MissingPrograms
-  Call FindDictionaries
+  Call FindDictionaries # function from dictionaries.nsh
 FunctionEnd
 
 # ---------------------------------------
@@ -179,49 +179,6 @@ FunctionEnd
 
 # ---------------------------------------
 
-Function FindDictionaries
-  # find the installed dictionaries
-
-  # start with empty strings
-  StrCpy $FoundDict ""
-  StrCpy $FoundThes ""
-  
-  # read out the possible spell-checker filenames from the file        
-  FileOpen $R5 "$INSTDIR\Resources\HunspellDictionaryNames.txt" r
-  ${for} $5 1 66
-   # the file has 132 lines, but we only need to check for one of the 2 dictionary files per language
-   # therefore check only for every second line
-   FileRead $R5 $String   # skip the .aff file
-   FileRead $R5 $String   # $String is now the .dic filename
-   StrCpy $String $String -2 # remove the linebreak characters
-   StrCpy $R3 $String -4 # $R3 is now the dictionary language code
-   !insertmacro FileCheck $4 $String "$INSTDIR\Resources\dicts" # macro from LyXUtils.nsh
-   ${if} $4 == "True"
-    StrCpy $FoundDict "$R3 $FoundDict"
-   ${endif}
-  ${next}
-  FileClose $R5
-  
-  # read out the possible thesaurus filenames from the file    
-  FileOpen $R5 "$INSTDIR\Resources\ThesaurusDictionaryNames.txt" r
-  ${for} $5 1 22
-   # the file has 44 lines, but we only need to check for one of the 2 dictionary files per language
-   # therefore check only for every second line
-   FileRead $R5 $String   # $String is now the dictionary name
-   FileRead $R5 $String   # $String is now the dictionary name
-   StrCpy $String $String -2 # remove the linebreak characters
-   StrCpy $R3 $String 5 3 # $R3 is now the dictionary language code
-   !insertmacro FileCheck $4 $String "$INSTDIR\Resources\thes" # macro from LyXUtils.nsh
-   ${if} $4 == "True"
-    StrCpy $FoundThes "$R3 $FoundThes"
-   ${endif}
-  ${next}
-  FileClose $R5
-
-FunctionEnd
-
-# ---------------------------------------
-
 Function EditorCheck
   # test if an editor with syntax-highlighting for LaTeX-files is installed
 
diff --git a/development/Win32/packaging/installer/include/dictionaries.nsh b/development/Win32/packaging/installer/include/dictionaries.nsh
new file mode 100644 (file)
index 0000000..14ee692
--- /dev/null
@@ -0,0 +1,218 @@
+/*
+dictionaries.nsh
+
+Handling of hunspell / MyThes dictionaries
+*/
+
+# This script contains the following functions:
+#
+# - FindDictionaries (finds already installed dictionaries)
+#
+# - DownloadHunspellDictionaries and DownloadThesaurusDictionaries
+#    (Downloads hunspell / MyThes dictionaries from a location that is
+#     given in the file $INSTDIR\Resources\HunspellDictionaryNames.txt)
+#
+# - InstallHunspellDictionaries and InstallThesaurusDictionaries
+#    (installs the selected hunspell / MyThes dictionaries except of
+#     already existing ones), uses:
+#    DownloadHunspellDictionaries or DownloadThesaurusDictionaries
+
+# ---------------------------------------
+
+Function FindDictionaries
+  # finds already installed dictionaries
+
+  # start with empty strings
+  StrCpy $FoundDict ""
+  StrCpy $FoundThes ""
+  
+  # read out the possible spell-checker filenames from the file        
+  FileOpen $R5 "$INSTDIR\Resources\HunspellDictionaryNames.txt" r
+  ${for} $5 1 66
+   # the file has 132 lines, but we only need to check for one of the 2 dictionary files per language
+   # therefore check only for every second line
+   FileRead $R5 $String   # skip the .aff file
+   FileRead $R5 $String   # $String is now the .dic filename
+   StrCpy $String $String -2 # remove the linebreak characters
+   StrCpy $R3 $String -4 # $R3 is now the dictionary language code
+   ${if} ${FileExists} "$INSTDIR\Resources\dicts\$String"
+    StrCpy $FoundDict "$R3 $FoundDict"
+   ${endif}
+  ${next}
+  FileClose $R5
+  
+  # read out the possible thesaurus filenames from the file    
+  FileOpen $R5 "$INSTDIR\Resources\ThesaurusDictionaryNames.txt" r
+  ${for} $5 1 22
+   # the file has 44 lines, but we only need to check for one of the 2 dictionary files per language
+   # therefore check only for every second line
+   FileRead $R5 $String   # $String is now the dictionary name
+   FileRead $R5 $String   # $String is now the dictionary name
+   StrCpy $String $String -2 # remove the linebreak characters
+   StrCpy $R3 $String 5 3 # $R3 is now the dictionary language code
+   ${if} ${FileExists} "$INSTDIR\Resources\thes\$String"
+    StrCpy $FoundThes "$R3 $FoundThes"
+   ${endif}
+  ${next}
+  FileClose $R5
+
+FunctionEnd
+
+# ---------------------------------------
+
+Function DownloadHunspellDictionaries
+ # Downloads hunspell dictionaries from a location that is given in the file
+ # $INSTDIR\Resources\HunspellDictionaryNames.txt
+ # read out the locations from the file        
+ FileOpen $R5 "$INSTDIR\Resources\HunspellDictionaryNames.txt" r
+ ${For} $5 1 132       # the file has 132 lines
+  FileRead $R5 $String # $String is now the dictionary name
+  StrCpy $R3 $String -6 # $R3 is now the dictionary language code
+  
+  ${if} $DictCode == $R3
+   StrCpy $String $String -2 # delete the linebreak characters at the end
+   # Download hunspell dictionaries,
+   # if first download repository is not available try the other ones listed in "DictionaryMirrors.txt"
+   FileOpen $R4 "$INSTDIR\Resources\DictionaryMirrors.txt" r
+   
+   ${For} $4 1 8
+    FileRead $R4 $Search # $Search is now the mirror
+    StrCpy $Search $Search -2 # delete the linebreak characters at the end
+    Push $R0
+    InetLoad::load /TIMEOUT=5000 "http://$Search.dl.sourceforge.net/project/lyxwininstaller/hunspell/$String" "$INSTDIR\Resources\dicts\$String" /END
+    Pop $R0
+    ${if} $R0 == "OK"
+     ${ExitFor}
+    ${endif}
+   ${Next}
+   
+   FileClose $R4
+   # if download failed
+   ${if} $R0 != "OK"
+    MessageBox MB_OK|MB_ICONEXCLAMATION "$(HunspellFailed)"
+    Goto abortinstall
+   ${endif}
+  ${endif} # end if $DictCode == $R3
+  
+ ${Next}
+ FileClose $R5
+
+  abortinstall:
+  Delete "$INSTDIR\$String"
+
+FunctionEnd
+
+#--------------------------------
+
+Function DownloadThesaurusDictionaries
+ # Downloads thesaurus dictionaries from a location that is given in the file
+ # $INSTDIR\Resources\ThesaurusDictionaryNames.txt
+ # read out the locations from the file        
+ FileOpen $R5 "$INSTDIR\Resources\ThesaurusDictionaryNames.txt" r
+ ${For} $5 1 44          # the file has 44 lines
+  FileRead $R5 $String   # $String is now the dictionary name
+  StrCpy $R3 $String 5 3 # $R3 is now the dictionary language code
+  
+  ${if} $ThesCode == $R3
+   StrCpy $String $String -2 # delete the linebreak characters at the end
+   # Download thesaurus dictionaries,
+   # if first download repository is not available try the other ones listed in "DictionaryMirrors.txt"
+   FileOpen $R4 "$INSTDIR\Resources\DictionaryMirrors.txt" r
+   
+   ${For} $4 1 8
+    FileRead $R4 $Search # $Search is now the mirror
+    StrCpy $Search $Search -2 # delete the linebreak characters at the end
+    Push $R0
+    InetLoad::load /TIMEOUT=5000 "http://$Search.dl.sourceforge.net/project/lyxwininstaller/thesaurus/$String" "$INSTDIR\Resources\thes\$String" /END
+    Pop $R0
+    ${if} $R0 == "OK"
+     ${ExitFor}
+    ${endif}
+   ${Next}
+   
+   FileClose $R4
+   # if download failed
+   ${if} $R0 != "OK"
+    MessageBox MB_OK|MB_ICONEXCLAMATION "$(ThesaurusFailed)"
+    Goto abortinstall
+   ${endif}
+  ${endif} # end if $ThesCode == $R3
+  
+ ${Next}
+ FileClose $R5
+
+  abortinstall:
+  Delete "$INSTDIR\$String"
+
+FunctionEnd
+
+#--------------------------------
+
+Function InstallHunspellDictionaries
+ # installs the selected hunspell dictionaries except of already existing ones
+
+ # download the dictionaries
+ ${Do}
+  # take the first code
+  StrCpy $Search ","
+  StrCpy $String $DictCodes
+  Call StrPoint
+  ${if} $Pointer != "-1"
+   StrCpy $DictCode $DictCodes $Pointer
+   # remove the taken code from the list
+   IntOp $Pointer $Pointer + 1
+   StrCpy $DictCodes $DictCodes "" $Pointer
+  ${endif}
+  # don't dowload existing ones thus check if $DictCode is in $FoundDict
+  StrCpy $String $FoundDict
+  StrCpy $Search $DictCode
+  Call StrPoint # function from LyXUtils.nsh
+  ${if} $Pointer == "-1"
+   Call DownloadHunspellDictionaries
+  ${endif}
+ ${LoopUntil} $DictCodes == ""
+FunctionEnd
+
+#--------------------------------
+
+Function InstallThesaurusDictionaries
+ # installs the selected thesaurus dictionaries except of already existing ones
+
+ # download the dictionaries
+ ${Do}
+  # all codes have 5 characters
+  StrCpy $ThesCode $ThesCodes 5 # take the first code
+  StrCpy $ThesCodes $ThesCodes "" 5 # remove the taken code from the list
+  # don't dowload existing ones thus check if $ThesCode is in $FoundThes
+  StrCpy $String $FoundThes
+  StrCpy $Search $ThesCode
+  Call StrPoint # function from LyXUtils.nsh
+  ${if} $Pointer == "-1"
+   Call DownloadThesaurusDictionaries
+  ${endif}
+ ${LoopUntil} $ThesCodes == ""
+ # some dictionaries of language variants are identic
+ # therefore copy and rename an existing dictionary
+ CreateDirectory "$INSTDIR\Resources\backup"
+ ${if} ${FileExists} "$INSTDIR\Resources\thes\th_de_DE_v2.dat"
+  CopyFiles "$INSTDIR\Resources\thes\th_de_DE_v2.*" "$INSTDIR\Resources\backup"
+  Rename "$INSTDIR\Resources\backup\th_de_DE_v2.dat" "$INSTDIR\Resources\backup\th_de_AT_v2.dat"
+  Rename "$INSTDIR\Resources\backup\th_de_DE_v2.idx" "$INSTDIR\Resources\backup\th_de_AT_v2.idx"
+  CopyFiles "$INSTDIR\Resources\backup\th_de_AT_v2.*" "$INSTDIR\Resources\thes"
+ ${endif}
+ ${if} ${FileExists} "$INSTDIR\Resources\thes\th_en_US_v2.dat"
+  CopyFiles "$INSTDIR\Resources\thes\th_en_US_v2.*" "$INSTDIR\Resources\backup"
+  Rename "$INSTDIR\Resources\backup\th_en_US_v2.dat" "$INSTDIR\Resources\backup\th_en_AU_v2.dat"
+  Rename "$INSTDIR\Resources\backup\th_en_US_v2.idx" "$INSTDIR\Resources\backup\th_en_AU_v2.idx"
+  CopyFiles "$INSTDIR\Resources\backup\th_en_AU_v2.*" "$INSTDIR\Resources\thes"
+ ${endif}
+ RMDir "$INSTDIR\Resources\backup"
+FunctionEnd
+
index aaf9d4ff1a6874c9133365160ff16a08c7347000..5a4015c983a551125380064c1e462029c48d019f 100644 (file)
@@ -23,7 +23,6 @@ BrandingText " "
 !define MUI_HEADERIMAGE_RIGHT
 !define MUI_WELCOMEFINISHPAGE_BITMAP "${SETUP_WIZARDIMAGE}"
 !define MUI_UNWELCOMEFINISHPAGE_BITMAP "${SETUP_WIZARDIMAGE}"
-!define MUI_COMPONENTSPAGE_NODESC
 
 #--------------------------------
 # Pages
index 7d296ffd4845d4a803cc0798569b690aad8e8fb0..058971d9abcebaf3dd62a529bf4a9fe3d4479a65 100644 (file)
@@ -1,9 +1,7 @@
 /*
-
 init.nsh
 
-Initialization function
-
+Initialization functions
 */
 
 #--------------------------------
@@ -58,7 +56,7 @@ SectionEnd
 
 !if ${SETUPTYPE} == BUNDLE
  Section /o "$(SecInstJabRefTitle)" SecInstJabRef
-  AddSize 5000
+  AddSize 12400
   StrCpy $InstallJabRef "true"
  SectionEnd
 !endif
@@ -540,6 +538,8 @@ SectionGroupEnd
 !if ${SETUPTYPE} == BUNDLE
  !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
 !endif
+!insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
+!insertmacro MUI_DESCRIPTION_TEXT ${SecThesaurus} "$(SecThesaurusDescription)"
 !insertmacro MUI_FUNCTION_DESCRIPTION_END
 
 
@@ -1313,7 +1313,7 @@ Function un.onInit
    MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
    Abort
   ${endif}
-  # abort when LyX couldn't be found in the registry
+  # warning when LyX couldn't be found in the registry
   ${if} $0 == "" # check in HKCU
    ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
    ${if} $0 == ""
@@ -1329,17 +1329,15 @@ Function un.onInit
   ${if} $0 == "Yes${APP_SERIES_KEY}"
    SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
    StrCpy $LaTeXInstalled "MiKTeX"
-   DeleteRegValue SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
   ${else}
    SectionSetText 2 "" # hides the corresponding uninstaller section
   ${endif}
   
   # test if JabRef was installed together with LyX
-  ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
+  ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
   ${if} $0 == "Yes${APP_SERIES_KEY}"
    SectionSetText 3 "JabRef" # names the corersponding uninstaller section
    StrCpy $JabRefInstalled "Yes"
-   DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
   ${else}
    SectionSetText 3 "" # hides the corresponding uninstaller section
   ${endif}
index 108ae0cb714f9f95caa43179fa222016ff36c837..0a6585d490ebf27b07108408c210cecf4d4b88cb 100644 (file)
@@ -48,8 +48,8 @@ Configuration of standard NSIS header files
  !include gui\LaTeXFolder.nsh
 !endif # end if != BUNDLE
 
-# Functions download dictionaries
-!include include\Thesaurus.nsh
+# Functions to download spell-checker and thesaurus dictionaries
+!include include\dictionaries.nsh
 
 #--------------------------------
 # Include standard functions
diff --git a/development/Win32/packaging/installer/include/thesaurus.nsh b/development/Win32/packaging/installer/include/thesaurus.nsh
deleted file mode 100644 (file)
index 9f9a464..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-# download dictionaries
-
-Function DownloadHunspellDictionary
- # Downloads hunspell dictionaries from a location that is given in the file
- # $INSTDIR\Resources\HunspellDictionaryNames.txt
- # read out the locations from the file        
- FileOpen $R5 "$INSTDIR\Resources\HunspellDictionaryNames.txt" r
- ${For} $5 1 132       # the file has 132 lines
-  FileRead $R5 $String # $String is now the dictionary name
-  StrCpy $R3 $String -6 # $R3 is now the dictionary language code
-  
-  ${if} $DictCode == $R3
-   StrCpy $String $String -2 # delete the linebreak characters at the end
-   # Download hunspell dictionaries,
-   # if first download repository is not available try the other ones listed in "DictionaryMirrors.txt"
-   FileOpen $R4 "$INSTDIR\Resources\DictionaryMirrors.txt" r
-   
-   ${For} $4 1 8
-    FileRead $R4 $Search # $Search is now the mirror
-    StrCpy $Search $Search -2 # delete the linebreak characters at the end
-    Push $R0
-    InetLoad::load /TIMEOUT=5000 "http://$Search.dl.sourceforge.net/project/lyxwininstaller/hunspell/$String" "$INSTDIR\Resources\dicts\$String" /END
-    Pop $R0
-    ${if} $R0 == "OK"
-     ${ExitFor}
-    ${endif}
-   ${Next}
-   
-   FileClose $R4
-   # if download failed
-   ${if} $R0 != "OK"
-    MessageBox MB_OK|MB_ICONEXCLAMATION "$(HunspellFailed)"
-    Goto abortinstall
-   ${endif}
-  ${endif} # end if $DictCode == $R3
-  
- ${Next}
- FileClose $R5
-
-  abortinstall:
-  Delete "$INSTDIR\$String"
-
-FunctionEnd
-
-#--------------------------------
-
-Function DownloadThesaurusDictionary
- # Downloads thesaurus dictionaries from a location that is given in the file
- # $INSTDIR\Resources\ThesaurusDictionaryNames.txt
- # read out the locations from the file        
- FileOpen $R5 "$INSTDIR\Resources\ThesaurusDictionaryNames.txt" r
- ${For} $5 1 44          # the file has 44 lines
-  FileRead $R5 $String   # $String is now the dictionary name
-  StrCpy $R3 $String 5 3 # $R3 is now the dictionary language code
-  
-  ${if} $ThesCode == $R3
-   StrCpy $String $String -2 # delete the linebreak characters at the end
-   # Download thesaurus dictionaries,
-   # if first download repository is not available try the other ones listed in "DictionaryMirrors.txt"
-   FileOpen $R4 "$INSTDIR\Resources\DictionaryMirrors.txt" r
-   
-   ${For} $4 1 8
-    FileRead $R4 $Search # $Search is now the mirror
-    StrCpy $Search $Search -2 # delete the linebreak characters at the end
-    Push $R0
-    InetLoad::load /TIMEOUT=5000 "http://$Search.dl.sourceforge.net/project/lyxwininstaller/thesaurus/$String" "$INSTDIR\Resources\thes\$String" /END
-    Pop $R0
-    ${if} $R0 == "OK"
-     ${ExitFor}
-    ${endif}
-   ${Next}
-   
-   FileClose $R4
-   # if download failed
-   ${if} $R0 != "OK"
-    MessageBox MB_OK|MB_ICONEXCLAMATION "$(ThesaurusFailed)"
-    Goto abortinstall
-   ${endif}
-  ${endif} # end if $ThesCode == $R3
-  
- ${Next}
- FileClose $R5
-
-  abortinstall:
-  Delete "$INSTDIR\$String"
-
-FunctionEnd
-
-#--------------------------------
-
-Function InstallHunspellDictionary
- # install the selected hunspell dictionaries except of already existing ones
-
- # download the dictionaries
- ${Do}
-  # take the first code
-  StrCpy $Search ","
-  StrCpy $String $DictCodes
-  Call StrPoint
-  ${if} $Pointer != "-1"
-   StrCpy $DictCode $DictCodes $Pointer
-   # remove the taken code from the list
-   IntOp $Pointer $Pointer + 1
-   StrCpy $DictCodes $DictCodes "" $Pointer
-  ${endif}
-  # don't dowload existing ones thus check if $DictCode is in $FoundDict
-  StrCpy $String $FoundDict
-  StrCpy $Search $DictCode
-  Call StrPoint # function from LyXUtils.nsh
-  ${if} $Pointer == "-1"
-   Call DownloadHunspellDictionary
-  ${endif}
- ${LoopUntil} $DictCodes == ""
-FunctionEnd
-
-#--------------------------------
-
-Function InstallThesaurusDictionary
- # install the selected thesaurus dictionaries except of already existing ones
-
- # download the dictionaries
- ${Do}
-  # all codes have 5 characters
-  StrCpy $ThesCode $ThesCodes 5 # take the first code
-  StrCpy $ThesCodes $ThesCodes "" 5 # remove the taken code from the list
-  # don't dowload existing ones thus check if $ThesCode is in $FoundThes
-  StrCpy $String $FoundThes
-  StrCpy $Search $ThesCode
-  Call StrPoint # function from LyXUtils.nsh
-  ${if} $Pointer == "-1"
-   Call DownloadThesaurusDictionary
-  ${endif}
- ${LoopUntil} $ThesCodes == ""
- # some dictionaries of language variants are identic
- # therefore copy and rename an existing dictionary
- CreateDirectory "$INSTDIR\Resources\backup"
- ${if} ${FileExists} "$INSTDIR\Resources\thes\th_de_DE_v2.dat"
-  CopyFiles "$INSTDIR\Resources\thes\th_de_DE_v2.*" "$INSTDIR\Resources\backup"
-  Rename "$INSTDIR\Resources\backup\th_de_DE_v2.dat" "$INSTDIR\Resources\backup\th_de_AT_v2.dat"
-  Rename "$INSTDIR\Resources\backup\th_de_DE_v2.idx" "$INSTDIR\Resources\backup\th_de_AT_v2.idx"
-  CopyFiles "$INSTDIR\Resources\backup\th_de_AT_v2.*" "$INSTDIR\Resources\thes"
- ${endif}
- ${if} ${FileExists} "$INSTDIR\Resources\thes\th_en_US_v2.dat"
-  CopyFiles "$INSTDIR\Resources\thes\th_en_US_v2.*" "$INSTDIR\Resources\backup"
-  Rename "$INSTDIR\Resources\backup\th_en_US_v2.dat" "$INSTDIR\Resources\backup\th_en_AU_v2.dat"
-  Rename "$INSTDIR\Resources\backup\th_en_US_v2.idx" "$INSTDIR\Resources\backup\th_en_AU_v2.idx"
-  CopyFiles "$INSTDIR\Resources\backup\th_en_AU_v2.*" "$INSTDIR\Resources\thes"
- ${endif}
- RMDir "$INSTDIR\Resources\backup"
-FunctionEnd
index b9eea4617f060cb9cfdb7ab5b3397290fd77150f..e3e70d4f671800a97bf7a55325059f5bd28ac233 100644 (file)
@@ -33,6 +33,8 @@ ${LangFileString} SecInstJabRefDescription "Bibliography reference manager and e
 #${LangFileString} SecAllUsersDescription "Install LyX for all users or just the current user."
 ${LangFileString} SecFileAssocDescription "Files with a .lyx extension will automatically open in LyX."
 ${LangFileString} SecDesktopDescription "A LyX icon on the desktop."
+${LangFileString} SecDictionariesDescription "Spell-checker dictionaries that can be downloaded and installed."
+${LangFileString} SecThesaurusDescription "Thesaurus dictionaries that can be downloaded and installed."
 
 ${LangFileString} EnterLaTeXHeader1 'LaTeX-distribution'
 ${LangFileString} EnterLaTeXHeader2 'Set the LaTeX-distribution that LyX should use.'
@@ -84,7 +86,7 @@ ${LangFileString} ModifyingConfigureFailed "Could not set 'path_prefix' in the c
 ${LangFileString} InstallRunning "The installer is already running!"
 ${LangFileString} StillInstalled "LyX ${APP_SERIES_KEY2} is already installed! Deinstall LyX first."
 ${LangFileString} NewerInstalled "You are trying to install an older version of LyX than what you have installed.$\r$\n\
-                                 If you really need this, you must uninstall the existing LyX $OldVersionNumber before."
+                                 If you really want this, you must uninstall the existing LyX $OldVersionNumber before."
 
 ${LangFileString} MultipleIndexesNotAvailable "The support for using several indexes in a document will not be available because$\r$\n\
                                               MiKTeX was installed with administrator privileges but you are installing LyX without them."
@@ -106,7 +108,8 @@ ${LangFileString} UnLyXPreferencesTitle 'LyX$\'s user preferences'
 
 ${LangFileString} SecUnMiKTeXDescription "Uninstalls the LaTeX-distribution MiKTeX."
 ${LangFileString} SecUnJabRefDescription "Uninstalls the bibliography manager JabRef."
-${LangFileString} SecUnPreferencesDescription 'Deletes LyX$\'s configuration folder$\r$\n\
-                                          "$AppPre\username\$AppSuff\${APP_DIR_USERDATA}"$\r$\n\
-                                          for all users.'
+${LangFileString} SecUnPreferencesDescription 'Deletes LyX$\'s configuration$\r$\n\
+                                             (folder $\"$AppPre\username\$AppSuff\${APP_DIR_USERDATA}$\"$\r$\n\
+                                             for you or for all users (if you are admin).'
 ${LangFileString} SecUnProgramFilesDescription "Uninstall LyX and all of its components."
+
index beb96c05ebf0ad17afbc7028c2aa093b9bf129a8..1433651319652801f001b9d937692bfad255f141 100644 (file)
@@ -14,39 +14,41 @@ ${LangFileString} TEXT_WELCOME "Dieser Assistent wird Sie durch die Installation
                                $\r$\n\
                                $_CLICK"
 
-${LangFileString} TEXT_CONFIGURE_MIKTEXFNDB "Aktualisiere MiKTeXs Dateinamen Datenbank..."
+#${LangFileString} TEXT_CONFIGURE_MIKTEXFNDB "Aktualisiere MiKTeXs Dateinamen Datenbank..."
 ${LangFileString} TEXT_CONFIGURE_LYX "Konfiguriere LyX (MiKTeX kann fehlende Pakte herunterladen, was etwas Zeit braucht) ..."
 ${LangFileString} TEXT_CONFIGURE_PYTHON "Kompiliere Python Skripte..."
 
 ${LangFileString} TEXT_FINISH_DESKTOP "Ein Symbol auf der Arbeitsoberfläche erzeugen"
 ${LangFileString} TEXT_FINISH_WEBSITE "Besuchen Sie lyx.org für aktuelle Neuigkeiten"
 
-${LangFileString} FileTypeTitle "LyX-Dokument"
+#${LangFileString} FileTypeTitle "LyX-Dokument"
 
 ${LangFileString} SecInstJabRefTitle "JabRef"
-${LangFileString} SecAllUsersTitle "Für alle Nutzer installieren?"
+#${LangFileString} SecAllUsersTitle "Für alle Nutzer installieren?"
 ${LangFileString} SecFileAssocTitle "Dateizuordnungen"
 ${LangFileString} SecDesktopTitle "Desktopsymbol"
 
 ${LangFileString} SecCoreDescription "Das Programm LyX."
 ${LangFileString} SecInstJabRefDescription "Manager für bibliografische Referenzen und Editor für BibTeX-Dateien."
-${LangFileString} SecAllUsersDescription "LyX für alle Nutzer oder nur für den aktuellen Nutzer installieren."
+#${LangFileString} SecAllUsersDescription "LyX für alle Nutzer oder nur für den aktuellen Nutzer installieren."
 ${LangFileString} SecFileAssocDescription "Vernüpfung zwischen LyX und der .lyx Dateiendung."
 ${LangFileString} SecDesktopDescription "Verknüpfung zu LyX auf dem Desktop."
+${LangFileString} SecDictionariesDescription "Rechtschreibprüfung- Wörterbucher die heruntergeladen und installiert werden können."
+${LangFileString} SecThesaurusDescription "Thesaurus- Wörterbucher die heruntergeladen und installiert werden können."
 
 ${LangFileString} EnterLaTeXHeader1 'LaTeX-Distribution'
 ${LangFileString} EnterLaTeXHeader2 'Legen Sie die LaTeX-Distribution fest die LyX verwenden soll.'
 ${LangFileString} EnterLaTeXFolder 'Optional können Sie hier den Pfad zur Datei $\"latex.exe$\" angeben und damit die \
-                                          LaTeX-Distribution festlegen die LyX verwenden soll.$\r$\n\
-                                          Wenn Sie kein LaTeX verwenden, kann LyX keine Dokumente ausgeben!$\r$\n\
-                                          $\r$\n\
-                                          Der Installer hat auf Ihrem System die LaTeX-Distribution$\r$\n\
-                                          $\"$LaTeXName$\" erkannt. Unten angegeben ist ihr Pfad.'
+                                       LaTeX-Distribution festlegen die LyX verwenden soll.$\r$\n\
+                                       Wenn Sie kein LaTeX verwenden, kann LyX keine Dokumente ausgeben!$\r$\n\
+                                       $\r$\n\
+                                       Der Installer hat auf Ihrem System die LaTeX-Distribution$\r$\n\
+                                       $\"$LaTeXName$\" erkannt. Unten angegeben ist ihr Pfad.'
 ${LangFileString} EnterLaTeXFolderNone 'Geben Sie unten den Pfad zur Datei $\"latex.exe$\" an. Damit legen Sie fest welche \
-                                              LaTeX-Distribution LyX verwenden soll.$\r$\n\
-                                              Wenn Sie kein LaTeX verwenden, kann LyX keine Dokumente ausgeben!$\r$\n\
-                                              $\r$\n\
-                                              Der Installer konnte auf Ihrem System keine LaTeX-Distribution finden.'
+                                       LaTeX-Distribution LyX verwenden soll.$\r$\n\
+                                       Wenn Sie kein LaTeX verwenden, kann LyX keine Dokumente ausgeben!$\r$\n\
+                                       $\r$\n\
+                                       Der Installer konnte auf Ihrem System keine LaTeX-Distribution finden.'
 ${LangFileString} PathName 'Pfad zur Datei $\"latex.exe$\"'
 ${LangFileString} DontUseLaTeX "Kein LaTeX benutzen"
 ${LangFileString} InvalidLaTeXFolder 'Kann die Datei $\"latex.exe$\" nicht finden.'
@@ -56,34 +58,36 @@ ${LangFileString} LatexInfo 'Als N
                                    $\r$\n\
                                    !!! Bitte verwenden Sie alle voreingestellten Optionen des MiKTeX-Installers !!!'
 ${LangFileString} LatexError1 'Es konnte keine LaTeX-Distribution gefunden werden!$\r$\n\
-                                     LyX kann ohne eine LaTeX-Distribution wie z.B. $\"MiKTeX$\" nicht benutzt werden!$\r$\n\
-                                     Die Installation wird daher abgebrochen.'
+                               LyX kann ohne eine LaTeX-Distribution wie z.B. $\"MiKTeX$\" nicht benutzt werden!$\r$\n\
+                               Die Installation wird daher abgebrochen.'
 
 ${LangFileString} HunspellFailed 'Herunterladen des Wörterbuchs für Sprache $\"$R3$\" fehlgeschlagen.'
 ${LangFileString} ThesaurusFailed 'Herunterladen des Thesaurus für Sprache $\"$R3$\" fehlgeschlagen.'
 
 ${LangFileString} JabRefInfo 'Als Nächstes wird der Installer des Programms $\"JabRef$\" gestartet.$\r$\n\
-                                    Sie können alle voreingestellten Optionen des JabRef-Installers verwenden.'
+                               Sie können alle voreingestellten Optionen des JabRef-Installers verwenden.'
 ${LangFileString} JabRefError 'Das Programm $\"JabRef$\" konnte nicht erfolgreich installiert werden!$\r$\n\
-                                     Der Installer wird trotzdem fortgesetzt.$\r$\n\
-                                     Versuchen Sie JabRef später noch einmal zu installieren.'
+                               Der Installer wird trotzdem fortgesetzt.$\r$\n\
+                               Versuchen Sie JabRef später noch einmal zu installieren.'
 
-${LangFileString} LatexConfigInfo "Die folgende Konfiguration von LyX wird eine Weile dauern."
+#${LangFileString} LatexConfigInfo "Die folgende Konfiguration von LyX wird eine Weile dauern."
 
-${LangFileString} MiKTeXPathInfo "Damit jeder Benutzer später MiKTeX für seine Bedürfnisse anpassen kann,$\r$\n\
-                                        ist es erforderlich für MiKTeXs Installationsordner$\r$\n\
-                                        $MiKTeXPath $\r$\n\
-                                        und seine Unterordner Schreibrechte für alle Benutzer zu setzen."
+#${LangFileString} MiKTeXPathInfo "Damit jeder Benutzer später MiKTeX für seine Bedürfnisse anpassen kann,$\r$\n\
+#                                      ist es erforderlich für MiKTeXs Installationsordner$\r$\n\
+#                                      $MiKTeXPath $\r$\n\
+#                                      und seine Unterordner Schreibrechte für alle Benutzer zu setzen."
 ${LangFileString} MiKTeXInfo 'Die LaTeX-Distribution $\"MiKTeX$\" wird zusammen mit LyX verwendet werden.$\r$\n\
-                                    Es wird empfohlen dass Sie verfügbare MiKTeX-Updates mit Hilfe des Programms $\"MiKTeX Update Wizard$\"$\r$\n\
-                                    installieren, bevor sie LyX das erste Mal benutzen.$\r$\n\
-                                    Möchten Sie jetzt nach Updates für MiKTeX suchen?'
+                               Es wird empfohlen dass Sie verfügbare MiKTeX-Updates mit Hilfe des Programms $\"MiKTeX Update Wizard$\"$\r$\n\
+                               installieren, bevor sie LyX das erste Mal benutzen.$\r$\n\
+                               Möchten Sie jetzt nach Updates für MiKTeX suchen?'
 
 ${LangFileString} ModifyingConfigureFailed 'Der $\"PATH_präfix$\" (Liste mit Programmpfaden) konnte nicht im Konfigurationsskript gesetzt werden.'
-${LangFileString} RunConfigureFailed "Konnte das Konfigurationsskript nicht ausführen."
+#${LangFileString} RunConfigureFailed "Konnte das Konfigurationsskript nicht ausführen."
 ${LangFileString} NotAdmin "Sie benötigen Administratorrechte um LyX zu installieren!"
 ${LangFileString} InstallRunning "Der Installer läuft bereits!"
 ${LangFileString} StillInstalled "LyX ${APP_SERIES_KEY2} ist bereits installiert! Deinstallieren Sie LyX zuerst."
+${LangFileString} NewerInstalled "Sie versuchen eine Vesion von LyX zu installieren, die älter als die derzeit installierte ist.$\r$\n\
+                                 Wenn Sie das wirklich wollen, müssen Sie erst das existierende LyX $OldVersionNumber deinstallieren."
 
 ${LangFileString} MultipleIndexesNotAvailable "Die Unterstützung für mehrere Indexe in einem Dokument wird nicht verfügbar sein, denn$\r$\n\
                                               MiKTeX wurde mit Administratorrechten installiert aber Sie installieren LyX ohne diese."
@@ -91,9 +95,9 @@ ${LangFileString} MetafileNotAvailable "Die LyX Unterst
                                        sein, denn dafür müsste ein Software-Drucker für Windows installiert werden,$\r$\n\
                                        was jedoch nur mit Administratorrechten möglich ist."
 
-${LangFileString} FinishPageMessage "Glückwunsch! LyX wurde erfolgreich installiert.$\r$\n\
-                                           $\r$\n\
-                                           (Der erste Start von LyX kann etwas länger dauern.)"
+#${LangFileString} FinishPageMessage "Glückwunsch! LyX wurde erfolgreich installiert.$\r$\n\
+#                                          $\r$\n\
+#                                          (Der erste Start von LyX kann etwas länger dauern.)"
 ${LangFileString} FinishPageRun "LyX starten"
 
 ${LangFileString} UnNotInRegistryLabel "Kann LyX nicht in der Registry finden.$\r$\n\
@@ -105,9 +109,8 @@ ${LangFileString} UnLyXPreferencesTitle 'LyXs Benutzereinstellungen'
 
 ${LangFileString} SecUnMiKTeXDescription "Deinstalliert die LaTeX-Distribution MiKTeX."
 ${LangFileString} SecUnJabRefDescription "Deinstalliert den Bibliografiemanager JabRef."
-${LangFileString} SecUnPreferencesDescription 'Löscht LyXs Benutzereinstellungen,$\r$\n\
-                                                     (den Ornder:$\r$\n\
-                                                     $\"$AppPre\username\$AppSuff\${APP_DIR_USERDATA}$\")$\r$\n\
-                                                     für alle Benutzer.'
+${LangFileString} SecUnPreferencesDescription 'Löscht LyXs Benutzereinstellungen$\r$\n\
+                                               (Ordner $\"$AppPre\username\$AppSuff\${APP_DIR_USERDATA}$\")$\r$\n\
+                                               für Sie oder für alle Benutzer (wenn Sie Admin sind).'
 ${LangFileString} SecUnProgramFilesDescription "Deinstalliert LyX und all seine Komponenten."
 
index cdd71f8319930df2727161c958f1ef1c00c00eaa..2f33623c0737ab2218a3b8b605a89d4a48f680e1 100644 (file)
@@ -1,2 +1,11 @@
-!define SETUPTYPE BUNDLE
+/*
+LyX 2.0 Installer for Windows
+Authors: Joost Verburg, Angus Leeming, Uwe Stöhr
+Compatible with NSIS 2.46
+*/
+
+!ifndef SETUPTYPE
+ !define SETUPTYPE BUNDLE
+!endif
+
 !include lyx.nsi
\ No newline at end of file
index 410cc6430085b8d0e711c5ff6f681c49a294fa86..f18a0f9d6409c58f86db36c942918ac389783243 100644 (file)
@@ -1,2 +1,11 @@
-!define SETUPTYPE STANDARD
+/*
+LyX 2.0 Installer for Windows
+Authors: Joost Verburg, Angus Leeming, Uwe Stöhr
+Compatible with NSIS 2.46
+*/
+
+!ifndef SETUPTYPE
+ !define SETUPTYPE STANDARD
+!endif
+
 !include lyx.nsi
\ No newline at end of file
index 4c7e520835404bf71a291e75ea96e6ea3ad56818..bd4b9835bf06676b1c0484bfe3678615735d1d5e 100644 (file)
@@ -34,7 +34,7 @@ SetCompressor /SOLID lzma
 # set up the installer pages
 !include include\gui.nsh
 
-# 
+# sets the install sections and checks the system on starting the un/installer
 !include include\init.nsh
 
 # install LyX and needed third-party programs like Python etc.
@@ -46,8 +46,8 @@ SetCompressor /SOLID lzma
 # configure LyX (set start menu and write registry entries)
 !include setup\configure.nsh
 
-# 
-!include gui\external.nsh
+# provides downloads of external programs
+#!include gui\external.nsh
 
 #--------------------------------
 # Output file
index 27291bee4ef93f9881672c8c28e9dd9cbcbc7153..8586aa75188579edfc3f5fd9c068753e7e9ed202 100644 (file)
@@ -108,12 +108,19 @@ Section -ProgramFiles SecProgramFiles
      ExecWait "$INSTDIR\${JabRefInstall}"
      # test if JabRef is now installed
      StrCpy $PathBibTeXEditor ""
-     ReadRegStr $PathBibTeXEditor HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "UninstallString"    
+     ReadRegStr $PathBibTeXEditor SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "UninstallString"    
      ${if} $PathBibTeXEditor == ""
       MessageBox MB_OK|MB_ICONEXCLAMATION "$(JabRefError)"
      ${else}
-      WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX" "Yes${APP_SERIES_KEY}" # special entry to tell the uninstaller that it was installed with LyX
-     ${endif}
+      # special entry that it was installed together with LyX
+      # so that we can later uninstall it together with LyX
+      ${if} $MultiUser.Privileges == "Admin"
+      ${orif} $MultiUser.Privileges == "Power"
+       WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX" "Yes${APP_SERIES_KEY}"
+      ${else}
+       WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX" "Yes${APP_SERIES_KEY}"
+      ${endif}
+     ${endif} # end if PathBibTeXEditor
     ${endif}
    ${endif}
   !endif # end if BUNDLE
@@ -134,10 +141,10 @@ Section -ProgramFiles SecProgramFiles
   
   # download dictionaries and thesaurus
   ${if} $DictCodes != ""
-   Call InstallHunspellDictionary # Function from Thesaurus.nsh
+   Call InstallHunspellDictionaries # Function from dictionaries.nsh
   ${endif}
   ${if} $ThesCodes != ""
-   Call InstallThesaurusDictionary # Function from Thesaurus.nsh
+   Call InstallThesaurusDictionaries # Function from dictionaries.nsh
   ${endif}
   # finally delete the list of mirrors
   Delete "$INSTDIR\Resources\DictionaryMirrors.txt"
index 2eeaa07d487c40cdcb30ce537951faa96772ff5e..e47e1972517d5ad110376df4f434f2d9228b4656 100644 (file)
@@ -61,6 +61,8 @@ Section "un.LyX" un.SecUnProgramFiles
     DeleteRegKey SHCTX "Software\Classes\${APP_EXT}14"
     DeleteRegKey SHCTX "Software\Classes\${APP_EXT}15"
     DeleteRegKey SHCTX "Software\Classes\${APP_EXT}16"
+   # enable this for LyX 2.1!
+   # DeleteRegKey SHCTX "Software\Classes\${APP_EXT}20"
     DeleteRegKey SHCTX "Software\Classes\${APP_EXT}"
     DeleteRegKey SHCTX "Software\Classes\${APP_REGNAME_DOC}"
    ${endif}
@@ -83,7 +85,6 @@ Section "un.LyX" un.SecUnProgramFiles
   DeleteRegKey HKCR "Applications\lyx.exe"
   
   # File associations
-  
   ReadRegStr $FileAssociation SHELL_CONTEXT "Software\Classes\${APP_EXT}" ""
   
   ${If} $FileAssociation == "${APP_REGNAME_DOC}"
@@ -92,16 +93,17 @@ Section "un.LyX" un.SecUnProgramFiles
   
   ${If} $MultiUser.Privileges != "Admin"
     ${OrIf} $MultiUser.Privileges != "Power"
-
     # Delete Postscript printer for metafile to EPS conversion
     ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
-
   ${EndIf}
   
   # clean other registry entries
   DeleteRegKey SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\${APP_NAME}.exe"
   DeleteRegKey SHCTX "SOFTWARE\${APP_REGKEY}"
   
+  # delete info that programs were installed together with LyX
+  DeleteRegValue SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
+  DeleteRegValue SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"  
 
 SectionEnd
 
@@ -120,7 +122,7 @@ SectionEnd
 Section /o "un.MiKTeX" un.SecUnMiKTeX
 
  ${if} $LaTeXInstalled == "MiKTeX" # only uninstall MiKTeX when it was installed together with LyX 
-  ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MiKTeX ${MiKTeXDeliveredVersion}" "UninstallString"
+  ReadRegStr $1 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\MiKTeX ${MiKTeXDeliveredVersion}" "UninstallString"
   ExecWait $1 # run MiKTeX's uninstaller
  ${endif}
 
@@ -131,7 +133,7 @@ SectionEnd
 Section "un.JabRef" un.SecUnJabRef
 
  ${if} $JabRefInstalled == "Yes" # only uninstall JabRef when it was installed together with LyX 
-  ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "UninstallString"
+  ReadRegStr $1 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "UninstallString"
   ExecWait "$1" # run JabRef's uninstaller
  ${endif}