]> git.lyx.org Git - lyx.git/blob - development/Win32/packaging/installer/components/dicts.nsh
alphabetical order
[lyx.git] / development / Win32 / packaging / installer / components / dicts.nsh
1 /*
2
3 Aspell dictionaries
4
5 */
6
7 #--------------------------------
8 #Macros
9
10 !macro Dictionary FILE LANGNAME LANGCODE SIZE
11
12   Section /o "${LANGNAME}"
13   
14     AddSize ${SIZE}
15   
16     Push ${LANGCODE}
17     Push "${LANGNAME}"
18     Push ${FILE}
19     
20     Call DownloadDictionary
21     
22   SectionEnd
23   
24 !macroend
25
26 #--------------------------------
27 #Sections
28
29 Section -AspellDicts
30
31   Call GetAspellHive
32   Pop $AspellHive
33
34 SectionEnd
35
36 !define DICT '!insertmacro Dictionary'
37
38 ${DICT} af-0.50-0 "Afrikaans" af 915
39 ${DICT} ar-1.2-0 "Arabic" ar 4352
40 ${DICT} nb-0.50.1-0 "Bokmål" nb 3031
41 ${DICT} bg-4.0-0 "Bulgarian" bg 5345
42 ${DICT} ca-20040130-1 "Català" ca 1095
43 ${DICT} cs-20040614-1 "Ce\9atina" cs 2069
44 ${DICT} da-1.4.42-1 "Dansk" da 3036
45 ${DICT} de-20030222-1 "Deutsch" de 2872
46 ${DICT} en-6.0-0 "English" en 1130
47 ${DICT} es-0.50-2 "Español" es 2953
48 ${DICT} eo-0.50-2 "Esperanto" eo 3773
49 ${DICT} et-0.1.21-1 "Estonian" et 922
50 ${DICT} fr-0.50-3 "Français" fr 4331
51 ${DICT} gl-0.50-0 "Galego" gl 2974
52 ${DICT} el-0.50-3 "Greek" el 3204
53 ${DICT} he-1.0-0 "Hebrew" he 2024
54 ${DICT} hr-0.51-0 "Hrvatski" hr 1967
55 ${DICT} is-0.51.1-0 "Íslenska" is 1536
56 ${DICT} it-2.2_20050523-0 "Italiano" it 696
57 ${DICT} hu-0.99.4.2-0 "Magyar" hu 1608
58 ${DICT} nl-0.50-2 "Nederlands" nl 1526
59 ${DICT} nn-0.50.1-1 "Nynorsk" nn 1930
60 ${DICT} fa-0.11-0 "Persian" fa 1667
61 ${DICT} pl-6.0_20061121-0 "Polski" pl 1859
62 ${DICT} pt_PT-20070510-0 "Português" pt_PT 319
63 ${DICT} pt_BR-20070411-0 "Português do Brasil" pt_BR 2453
64 ${DICT} ro-0.50-2 "Româna" ro 341
65 ${DICT} ru-0.99f7-1 "Russian" ru 1458
66 ${DICT} gd-0.1.1-1 "Scottish" gd 194
67 ${DICT} sr-0.02 "Serbian" sr 3686
68 ${DICT} sk-0.52-0 "Slovencina" sk 4602
69 ${DICT} sl-0.50-0 "Sloven\9acina" sl 5236
70 ${DICT} fi-0.7-0 "Suomi" fi 659
71 ${DICT} sv-0.51-0 "Svenska" sv 1029
72 ${DICT} tr-0.50-0 "Türkçe" tr 547
73 ${DICT} uk-1.4.0-0 "Ukrainian" uk 770
74 ${DICT} cy-0.50-3 "Welsh" cy 1771
75
76 #--------------------------------
77 #Functions
78
79 Function GetAspellHive
80
81   #Check whether the system or local version of Aspell should be used
82   #The patched Aspell uses the same logic
83
84   Push $R0
85
86   ReadRegStr $R0 HKCU "Software\Aspell" "Base Path"
87
88   ${if} $R0 == ""
89     StrCpy $R0 HKLM
90   ${else}
91     StrCpy $R0 HKCU
92   ${endif}
93
94   Exch $R0
95
96 FunctionEnd
97
98 Function DownloadDictionary
99
100   Exch $R0
101   Exch 1
102   Exch $R1
103   Exch 2
104   Exch $R2
105   Push $R3
106
107   dict_download:
108
109     !insertmacro DownloadFile $R3 ASPELLDICTS aspell6-$R0.exe
110
111     ${if} $R3 != "OK"
112       #Download failed
113       MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(TEXT_DOWNLOAD_FAILED_DICT) ($R3)" IDYES dict_download
114       Goto dict_noinstall
115     ${endif}
116
117     install_dict:
118
119       ExecWait '"$PLUGINSDIR\aspell6-$R0.exe" /NoDirChange /AutoClose'
120
121       ${if} $AspellHive == HKLM
122         ReadRegStr $R3 HKLM "Software\Aspell\Dictionaries" $R2
123       ${else}
124             ReadRegStr $R3 HKCU "Software\Aspell\Dictionaries" $R2
125       ${endif}
126
127             ${if} $R3 == ""
128         MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(TEXT_NOTINSTALLED_DICT)" IDYES install_dict
129       ${endif}
130
131       Delete "$PLUGINSDIR\aspell6-$R0.exe"
132
133     dict_noinstall:
134
135   Pop $R3
136   Pop $R2
137   Pop $R1
138   Pop $R0
139
140 FunctionEnd