From c0d1f38294316ea7b5aff54b31b54f3103ae3c5e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Sun, 15 Apr 2007 12:36:14 +0000 Subject: [PATCH] LyXWinInstaller: fix bug in uninstalling Arabic Aspell dict git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17818 a592a061-630c-0410-9148-cb99ea01b6c8 --- .../installer/LyXWinInstaller/Aspell.nsh | 47 ++++---- .../installer/LyXWinInstaller/LaTeXFolder.nsh | 4 +- .../LyXWinInstaller/LanguageSettings.nsh | 100 +++++++++--------- .../LyXWinInstaller/abi_util_fileassoc.nsh | 58 +++++----- 4 files changed, 105 insertions(+), 104 deletions(-) diff --git a/development/Win32/packaging/installer/LyXWinInstaller/Aspell.nsh b/development/Win32/packaging/installer/LyXWinInstaller/Aspell.nsh index 773eb20a64..303ce7d941 100644 --- a/development/Win32/packaging/installer/LyXWinInstaller/Aspell.nsh +++ b/development/Win32/packaging/installer/LyXWinInstaller/Aspell.nsh @@ -1,4 +1,4 @@ -# Aspell dictionaries +; Aspell dictionaries Function DownloadDictionary @@ -7,7 +7,7 @@ Function DownloadDictionary FileRead $R5 $String ; $String is now the dictionary name StrCpy $R3 $String 2 ; $R3 is now the dictionary language code ${if} $R3 == "tr" - ${andif} $DictCode != "tr" ; if nothing was found + ${andif} $DictCode != "tr" ; if nothing was found (the last line in the file starts with "tr") FileClose $R5 StrCpy $String "" StrCpy $AspellInstallYes "$RunNumber$AspellInstallYes" @@ -18,8 +18,8 @@ Function DownloadDictionary StrCpy $String $String -2 ; delete the linebreak characters at the end - # Download aspell dictionaries, - # if first download repository is not available try the other ones listed in "AspellRepositories.txt" + ; Download aspell dictionaries, + ; if first download repository is not available try the other ones listed in "AspellRepositories.txt" FileOpen $R5 "$INSTDIR\Resources\AspellRepositories.txt" r ${For} $4 1 4 FileRead $R5 $Search ; $Search is now the AspellLocation @@ -27,8 +27,8 @@ Function DownloadDictionary Push $R0 InetLoad::load /TIMEOUT=5000 "$Search/aspell6-$String.exe" "$INSTDIR\aspell6-$String.exe" /END Pop $R0 - # test if the downloaded file is really the expected one, because if the file didn't exist on the download server, - # berlios.de downloads a text file with the name of the non-existing file that contains the line "File doesn't exist" + ; test if the downloaded file is really the expected one, because if the file didn't exist on the download server, + ; berlios.de downloads a text file with the name of the non-existing file that contains the line "File doesn't exist" FileOpen $R4 "$INSTDIR\aspell6-$String.exe" r FileRead $R4 $Search FileClose $R4 @@ -42,14 +42,14 @@ Function DownloadDictionary ${Next} FileClose $R5 - # Download failed + ; Download failed ${if} $R0 != "OK" MessageBox MB_OK|MB_ICONEXCLAMATION "$(AspellDownloadFailed) $R0" StrCpy $AspellInstallYes "$RunNumber$AspellInstallYes" Goto abortinstall ${endif} - # Download successful + ; Download successful ExecWait '"$INSTDIR\aspell6-$String.exe" /NoDirChange /AutoClose' ${if} $AspellBaseReg == "HKLM" ReadRegStr $R2 HKLM "Software\Aspell\Dictionaries" $DictCode @@ -66,13 +66,13 @@ Function DownloadDictionary FunctionEnd -#-------------------------------- +;-------------------------------- Function InstallAspellDictionary StrCpy $AspellInstallYes "" - # install the english dictionary if not already installed + ; install the english dictionary if not already installed StrCpy $DictCode "en" StrCpy $RunNumber "1" ${if} $AspellBaseReg == "HKLM" ; $AspellBaseReg is either "HKLM" or if Aspell is already installed only for the current user "HKCU" @@ -88,9 +88,9 @@ Function InstallAspellDictionary StrCpy $AspellInstallYes "$RunNumber$AspellInstallYes" ${endif} - # install the dictionary corresponding to the system and the chosen menu language - # check if the system language and the chosen menu language are the same, if not install - # both dictionaries + ; install the dictionary corresponding to the system and the chosen menu language + ; check if the system language and the chosen menu language are the same, if not install + ; both dictionaries StrCpy $DictCode $LangCode 2 StrCpy $0 $DictCode ; $0 is now the language code of the chosen LyX menu language StrCpy $RunNumber "2" @@ -136,7 +136,7 @@ Function InstallAspellDictionary StrCpy $AspellInstallYes "4$AspellInstallYes" ${endif} - # check the registry to divide between nothing installed or all already installed + ; check the registry to divide between nothing installed or all already installed ${if} $AspellInstallYes == "321" ${orif} $AspellInstallYes == "421" ${if} $AspellBaseReg == "HKLM" @@ -167,12 +167,12 @@ Function InstallAspellDictionary Delete "$INSTDIR\Resources\AspellDictionaryNames.txt" Delete "$INSTDIR\Resources\AspellRepositories.txt" - # show message about Aspell dictionaries - # the code rule to display the correct message: - # - when the englisch dictionary is already installed or couldn't be installed -> set a "1" - # - when the dictionary of the chosen LyX menu language is already installed or couldn't be installed -> set a "2" - # - when the dictionary of the Windows system language is already installed or couldn't be installed -> set a "3" - # - when the dictionary of the chosen LyX menu language is equal to the dictionary of the Windows system language -> set a "4" + ; show message about Aspell dictionaries + ; the code rule to display the correct message: + ; - when the englisch dictionary is already installed or couldn't be installed -> set a "1" + ; - when the dictionary of the chosen LyX menu language is already installed or couldn't be installed -> set a "2" + ; - when the dictionary of the Windows system language is already installed or couldn't be installed -> set a "3" + ; - when the dictionary of the chosen LyX menu language is equal to the dictionary of the Windows system language -> set a "4" ${if} $AspellInstallYes == "32" ${orif} $AspellInstallYes == "42" MessageBox MB_ICONINFORMATION|MB_DEFBUTTON2|MB_YESNO "$(AspellPartStart)$(AspellPart1)$(AspellPart4)" IDYES DownloadNow IDNO DownloadLater @@ -208,18 +208,19 @@ Function InstallAspellDictionary FunctionEnd -#--------------------------- +;--------------------------- Function un.UninstAspell ReadRegStr $1 HKLM "Software\Aspell" "Base Path" - # delete Aspells' install folder + ; delete Aspells' install folder RMDir /r $1 - # unregister Aspell and its dictionaries + ; unregister Aspell and its dictionaries DeleteRegKey HKLM "Software\Aspell" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Aspell" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Aspell6-Dictionary-af" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Aspell6-Dictionary-am" + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Aspell6-Dictionary-ar" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Aspell6-Dictionary-az" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Aspell6-Dictionary-be" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Aspell6-Dictionary-bg" diff --git a/development/Win32/packaging/installer/LyXWinInstaller/LaTeXFolder.nsh b/development/Win32/packaging/installer/LyXWinInstaller/LaTeXFolder.nsh index d74a224c0e..92d8b564b2 100644 --- a/development/Win32/packaging/installer/LyXWinInstaller/LaTeXFolder.nsh +++ b/development/Win32/packaging/installer/LyXWinInstaller/LaTeXFolder.nsh @@ -1,7 +1,7 @@ Function LatexFolder !insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_latex.ini" - # generate the installer page + ; generate the installer page !insertmacro MUI_HEADER_TEXT "$(EnterLaTeXHeader1)" "$(EnterLaTeXHeader2)" ${if} $LatexName != "" !insertmacro MUI_INSTALLOPTIONS_WRITE "io_latex.ini" "Field 1" "Text" "$(EnterLaTeXFolder)" @@ -24,7 +24,7 @@ Function LatexFolder Goto ReadyFolder ${endif} !insertmacro MUI_INSTALLOPTIONS_READ "$LatexPath" "io_latex.ini" "Field 3" "State" - # check if the latex.exe exists in the $LatexPath folder + ; check if the latex.exe exists in the $LatexPath folder !insertmacro FileCheck $5 "latex.exe" "$LatexPath" ${if} $5 == "False" MessageBox MB_RETRYCANCEL "$(InvalidLaTeXFolder)" IDRETRY AgainFolder diff --git a/development/Win32/packaging/installer/LyXWinInstaller/LanguageSettings.nsh b/development/Win32/packaging/installer/LyXWinInstaller/LanguageSettings.nsh index a273e1ad50..59a044e68c 100644 --- a/development/Win32/packaging/installer/LyXWinInstaller/LanguageSettings.nsh +++ b/development/Win32/packaging/installer/LyXWinInstaller/LanguageSettings.nsh @@ -1,10 +1,10 @@ -# Language settings for the installer -# create language code for the Windows system language +; Language settings for the installer +; create language code for the Windows system language -# LangNme is the language name when there exists a LyX translation for this language; used for the menu language dialog and for the Aspell installation -# LangNmeSys is the Windows system language; used for the Aspell installation -# LangCdeSys is the ISO 630 language code of the language; used for the Aspell installation -# LangSysEnc is the Windows codepage for the character encoding of the language; used in lyx.bat to assure that scripts are correctly executed +; LangNme is the language name when there exists a LyX translation for this language; used for the menu language dialog and for the Aspell installation +; LangNmeSys is the Windows system language; used for the Aspell installation +; LangCdeSys is the ISO 630 language code of the language; used for the Aspell installation +; LangSysEnc is the Windows codepage for the character encoding of the language; used in lyx.bat to assure that scripts are correctly executed !macro TranslateLangCode LangNme LangNmeSys LangCdeSys LangISOCode LangSysEnc StrCpy ${LangCdeSys} "" @@ -27,11 +27,11 @@ StrCpy ${LangSysEnc} "1252" ${endif} -# currently no dictionary available -# ${if} ${LangISOCode} = 1028 -# StrCpy ${LangCdeSys} "zh" -# StrCpy ${LangNmeSys} "Chinese" -# ${endif} +; currently no dictionary available +; ${if} ${LangISOCode} = 1028 +; StrCpy ${LangCdeSys} "zh" +; StrCpy ${LangNmeSys} "Chinese" +; ${endif} ${if} ${LangISOCode} = 1029 StrCpy ${LangNme} "Ceština" @@ -114,17 +114,17 @@ StrCpy ${LangSysEnc} "1252" ${endif} -# currently no dictionary available -# ${if} ${LangISOCode} = 1041 -# StrCpy ${LangCdeSys} "ja" -# StrCpy ${LangNmeSys} "Japanese" -# ${endif} +; currently no dictionary available +; ${if} ${LangISOCode} = 1041 +; StrCpy ${LangCdeSys} "ja" +; StrCpy ${LangNmeSys} "Japanese" +; ${endif} -# currently no dictionary available -# ${if} ${LangISOCode} = 1042 -# StrCpy ${LangCdeSys} "ko" -# StrCpy ${LangNmeSys} "Korean" -# ${endif} +; currently no dictionary available +; ${if} ${LangISOCode} = 1042 +; StrCpy ${LangCdeSys} "ko" +; StrCpy ${LangNmeSys} "Korean" +; ${endif} ${if} ${LangISOCode} = 1043 StrCpy ${LangNme} "Nederlands" @@ -181,12 +181,12 @@ StrCpy ${LangSysEnc} "1250" ${endif} -# currently no dictionary available -# ${if} ${LangISOCode} = 1052 -# StrCpy ${LangCdeSys} "sq" -# StrCpy ${LangNmeSys} "Shqip" -# StrCpy ${LangSysEnc} "1252" -# ${endif} +; currently no dictionary available +; ${if} ${LangISOCode} = 1052 +; StrCpy ${LangCdeSys} "sq" +; StrCpy ${LangNmeSys} "Shqip" +; StrCpy ${LangSysEnc} "1252" +; ${endif} ${if} ${LangISOCode} = 1053 StrCpy ${LangNme} "Svenska" @@ -195,12 +195,12 @@ StrCpy ${LangSysEnc} "1252" ${endif} -# currently no dictionary available -# ${if} ${LangISOCode} = 1054 -# StrCpy ${LangCdeSys} "th" -# StrCpy ${LangNmeSys} "Thai" -# StrCpy ${LangSysEnc} "874" -# ${endif} +; currently no dictionary available +; ${if} ${LangISOCode} = 1054 +; StrCpy ${LangCdeSys} "th" +; StrCpy ${LangNmeSys} "Thai" +; StrCpy ${LangSysEnc} "874" +; ${endif} ${if} ${LangISOCode} = 1055 StrCpy ${LangNme} "Türkçe" @@ -240,7 +240,7 @@ StrCpy ${LangSysEnc} "1257" ${endif} - # currently no dictionary available + ; currently no dictionary available ${if} ${LangISOCode} = 1069 StrCpy ${LangNme} "Euskara" StrCpy ${LangCdeSys} "eu" @@ -254,11 +254,11 @@ StrCpy ${LangSysEnc} "1252" ${endif} -# currently no dictionary available -# ${if} ${LangISOCode} = 1081 -# StrCpy ${LangCdeSys} "hi" -# StrCpy ${LangNmeSys} "Hindi" -# ${endif} +; currently no dictionary available +; ${if} ${LangISOCode} = 1081 +; StrCpy ${LangCdeSys} "hi" +; StrCpy ${LangNmeSys} "Hindi" +; ${endif} ${if} ${LangISOCode} = 1110 StrCpy ${LangNme} "Galego" @@ -267,11 +267,11 @@ StrCpy ${LangSysEnc} "1252" ${endif} -# currently no dictionary available -# ${if} ${LangISOCode} = 2052 -# StrCpy ${LangCdeSys} "zh" -# StrCpy ${LangNmeSys} "Chinese" -# ${endif} +; currently no dictionary available +; ${if} ${LangISOCode} = 2052 +; StrCpy ${LangCdeSys} "zh" +; StrCpy ${LangNmeSys} "Chinese" +; ${endif} ${if} ${LangISOCode} = 2055 StrCpy ${LangCdeSys} "de" @@ -421,9 +421,9 @@ !macroend -#------------------------------------------ +;------------------------------------------ -# Setting LyX's menu language +; Setting LyX's menu language !macro GetLangCode LangCde Name LangEnc @@ -529,13 +529,13 @@ !macroend -#-------------------- +;-------------------- Function SelectMenuLanguage !insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_ui_language.ini" ${if} $LangName == "" - # translate NSIS's language code to the language name; macro from lyx_utils.nsh + ; translate NSIS's language code to the language name ; macro from lyx_utils.nsh !insertmacro TranslateLangCode $LangName $LangNameSys $LangCodeSys $Language $LangSysEncoding ${endif} @@ -555,9 +555,9 @@ FunctionEnd Function SelectMenuLanguage_LeaveFunction !insertmacro MUI_INSTALLOPTIONS_READ $LangName "io_ui_language.ini" "Field 2" "State" - # Get the language code; macro from lyx_utils.nsh + ; Get the language code StrCpy $LangCode "" - !insertmacro GetLangCode $LangCode $LangName $LangEncoding + !insertmacro GetLangCode $LangCode $LangName $LangEncoding ; macro from lyx_utils.nsh FunctionEnd diff --git a/development/Win32/packaging/installer/LyXWinInstaller/abi_util_fileassoc.nsh b/development/Win32/packaging/installer/LyXWinInstaller/abi_util_fileassoc.nsh index c46fb0eacc..e63e1d5098 100644 --- a/development/Win32/packaging/installer/LyXWinInstaller/abi_util_fileassoc.nsh +++ b/development/Win32/packaging/installer/LyXWinInstaller/abi_util_fileassoc.nsh @@ -1,5 +1,5 @@ -#Title AbiWord for Windows, NSIS v2 series installer script -#FileDesc Utility functions to set and save/restore file extension to application associations +;Title AbiWord for Windows, NSIS v2 series installer script +;FileDesc Utility functions to set and save/restore file extension to application associations !ifndef _ABI_UTIL_FILEASSOC_NSH_ @@ -7,10 +7,10 @@ !ifdef HAVE_SYSTEM_PLUGIN -#;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#; RefreshShellIcons based on -#; http://nsis.sourceforge.net/archive/nsisweb.php?page=236&instances=0 -#; by jerome tremblay - april 2003 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; RefreshShellIcons based on +;; http://nsis.sourceforge.net/archive/nsisweb.php?page=236&instances=0 +;; by jerome tremblay - april 2003 !define SHCNE_ASSOCCHANGED 0x08000000 !define SHCNF_IDLIST 0 @@ -26,29 +26,29 @@ FunctionEnd !endif ; HAVE_SYSTEM_PLUGIN -#;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#; parts from http://nsis.sourceforge.net/archive/viewpage.php?pageid=282 by Vytautas -#; Will add the registry entries to associate the given file extension with the -#; previously set (see CreateApplicationAssociation) appType. I.e. indicate to -#; open documents with this extension using the application specified by appType -#; registry entry. If the extension is currently associated with a different -#; appType, it will store the current association in the "prior_appType" key. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; parts from http://nsis.sourceforge.net/archive/viewpage.php?pageid=282 by Vytautas +;; Will add the registry entries to associate the given file extension with the +;; previously set (see CreateApplicationAssociation) appType. I.e. indicate to +;; open documents with this extension using the application specified by appType +;; registry entry. If the extension is currently associated with a different +;; appType, it will store the current association in the "prior_appType" key. !macro CreateFileAssociation extension appType contentType !define skipBackupLbl "skipBackup_${__LINE__}" push $0 - # back up old value of extension (.ext) if it exists + ; back up old value of extension (.ext) if it exists ReadRegStr $0 HKCR "${extension}" "" ; read current value StrCmp $0 "" "${skipBackupLbl}" ; nothing, then skip storing old value StrCmp $0 "${appType}" "${skipBackupLbl}" ; only store if old is different than current WriteRegStr HKCR "${extension}" "prior_value" "$0" ; actually store the old association "${skipBackupLbl}:" - # Write File Associations + ; Write File Associations WriteRegStr HKCR "${extension}" "" "${appType}" WriteRegStr HKCR "${extension}" "Content Type" "${contentType}" - # Force shell refresh (so icons updated as needed) + ; Force shell refresh (so icons updated as needed) ${RefreshShellIcons} pop $0 @@ -62,27 +62,27 @@ FunctionEnd WriteRegStr HKCR "${appType}\shell" "" "open" WriteRegStr HKCR "${appType}\DefaultIcon" "" "${defIcon}" - # Basic command to open the file (pass filename as argv[1] to program executable) + ; Basic command to open the file (pass filename as argv[1] to program executable) WriteRegStr HKCR "${appType}\shell\open\command" "" '"${exeCmd}" "%1"' - # To open file via DDE (OLE, ie via already active instance) instead of in a new process - # Here for those who want to locally enable, not normally used as having each document - # open in a new process while more resource intensive means a crash with one document - # won't cause loss of work with other open documents. -# WriteRegStr HKCR "${appType}\shell\open\command" "" "${exeCmd}" -# WriteRegStr HKCR "${appType}\shell\open\ddeexec" "" '[Open("%1")]' -# WriteRegStr HKCR "${appType}\shell\open\ddeexec\application" "" "${appName}" -# WriteRegStr HKCR "${appType}\shell\open\ddeexec\topic" "" "System" + ; To open file via DDE (OLE, ie via already active instance) instead of in a new process + ; Here for those who want to locally enable, not normally used as having each document + ; open in a new process while more resource intensive means a crash with one document + ; won't cause loss of work with other open documents. +; WriteRegStr HKCR "${appType}\shell\open\command" "" "${exeCmd}" +; WriteRegStr HKCR "${appType}\shell\open\ddeexec" "" '[Open("%1")]' +; WriteRegStr HKCR "${appType}\shell\open\ddeexec\application" "" "${appName}" +; WriteRegStr HKCR "${appType}\shell\open\ddeexec\topic" "" "System" - # If editing file is a different action than simply opening file -# WriteRegStr HKCR "${appType}\shell\edit" "" "Edit Options File" -# WriteRegStr HKCR "${appType}\shell\edit\command" "" '"${exeCmd}" "%1"' + ; If editing file is a different action than simply opening file +; WriteRegStr HKCR "${appType}\shell\edit" "" "Edit Options File" +; WriteRegStr HKCR "${appType}\shell\edit\command" "" '"${exeCmd}" "%1"' !macroend !define CreateApplicationAssociation "!insertmacro CreateApplicationAssociation" -# check if a file extension is associated with us and if so delete it +; check if a file extension is associated with us and if so delete it !macro RemoveFileAssociation extension appType push $0 push $1 -- 2.39.2