From: Uwe Stöhr Date: Sun, 11 Nov 2012 17:07:55 +0000 (+0100) Subject: installer: bugfixes, code simplification and documentation X-Git-Tag: 2.1.0beta1~1285 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=290efe6190c6c5ff6065af202acd476060c29861;p=lyx.git installer: bugfixes, code simplification and documentation - 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 --- diff --git a/development/Win32/packaging/installer/include/LaTeX.nsh b/development/Win32/packaging/installer/include/LaTeX.nsh index d1b0168192..d47dabcd7e 100644 --- a/development/Win32/packaging/installer/include/LaTeX.nsh +++ b/development/Win32/packaging/installer/include/LaTeX.nsh @@ -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 diff --git a/development/Win32/packaging/installer/include/detection.nsh b/development/Win32/packaging/installer/include/detection.nsh index d076302678..a27e5bbf78 100644 --- a/development/Win32/packaging/installer/include/detection.nsh +++ b/development/Win32/packaging/installer/include/detection.nsh @@ -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 index 0000000000..14ee6927e0 --- /dev/null +++ b/development/Win32/packaging/installer/include/dictionaries.nsh @@ -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 + diff --git a/development/Win32/packaging/installer/include/gui.nsh b/development/Win32/packaging/installer/include/gui.nsh index aaf9d4ff1a..5a4015c983 100644 --- a/development/Win32/packaging/installer/include/gui.nsh +++ b/development/Win32/packaging/installer/include/gui.nsh @@ -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 diff --git a/development/Win32/packaging/installer/include/init.nsh b/development/Win32/packaging/installer/include/init.nsh index 7d296ffd48..058971d9ab 100644 --- a/development/Win32/packaging/installer/include/init.nsh +++ b/development/Win32/packaging/installer/include/init.nsh @@ -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} diff --git a/development/Win32/packaging/installer/include/nsis.nsh b/development/Win32/packaging/installer/include/nsis.nsh index 108ae0cb71..0a6585d490 100644 --- a/development/Win32/packaging/installer/include/nsis.nsh +++ b/development/Win32/packaging/installer/include/nsis.nsh @@ -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 index 9f9a4643a6..0000000000 --- a/development/Win32/packaging/installer/include/thesaurus.nsh +++ /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 diff --git a/development/Win32/packaging/installer/lang/english.nsh b/development/Win32/packaging/installer/lang/english.nsh index b9eea4617f..e3e70d4f67 100644 --- a/development/Win32/packaging/installer/lang/english.nsh +++ b/development/Win32/packaging/installer/lang/english.nsh @@ -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." + diff --git a/development/Win32/packaging/installer/lang/german.nsh b/development/Win32/packaging/installer/lang/german.nsh index beb96c05eb..1433651319 100644 --- a/development/Win32/packaging/installer/lang/german.nsh +++ b/development/Win32/packaging/installer/lang/german.nsh @@ -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." diff --git a/development/Win32/packaging/installer/lyx-bundle.nsi b/development/Win32/packaging/installer/lyx-bundle.nsi index cdd71f8319..2f33623c07 100644 --- a/development/Win32/packaging/installer/lyx-bundle.nsi +++ b/development/Win32/packaging/installer/lyx-bundle.nsi @@ -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 diff --git a/development/Win32/packaging/installer/lyx-standard.nsi b/development/Win32/packaging/installer/lyx-standard.nsi index 410cc64300..f18a0f9d64 100644 --- a/development/Win32/packaging/installer/lyx-standard.nsi +++ b/development/Win32/packaging/installer/lyx-standard.nsi @@ -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 diff --git a/development/Win32/packaging/installer/lyx.nsi b/development/Win32/packaging/installer/lyx.nsi index 4c7e520835..bd4b9835bf 100644 --- a/development/Win32/packaging/installer/lyx.nsi +++ b/development/Win32/packaging/installer/lyx.nsi @@ -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 diff --git a/development/Win32/packaging/installer/setup/install.nsh b/development/Win32/packaging/installer/setup/install.nsh index 27291bee4e..8586aa7518 100644 --- a/development/Win32/packaging/installer/setup/install.nsh +++ b/development/Win32/packaging/installer/setup/install.nsh @@ -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" diff --git a/development/Win32/packaging/installer/setup/uninstall.nsh b/development/Win32/packaging/installer/setup/uninstall.nsh index 2eeaa07d48..e47e197251 100644 --- a/development/Win32/packaging/installer/setup/uninstall.nsh +++ b/development/Win32/packaging/installer/setup/uninstall.nsh @@ -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}