PortableApps.comInstallerCustom.nsh 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. Var InstallerCustomCodeUpgradeFrom
  2. Var InstallerCustomCodeUpgradeFromInstallType
  3. !macro CustomCodePreInstall
  4. ReadINIStr $InstallerCustomCodeUpgradeFrom "$INSTDIR\App\AppInfo\appinfo.ini" "Version" "PackageVersion"
  5. ReadINIStr $InstallerCustomCodeUpgradeFromInstallType "$INSTDIR\App\AppInfo\appinfo.ini" "Details" "InstallType"
  6. ${If} $InstallerCustomCodeUpgradeFrom != ""
  7. ${VersionCompare} $InstallerCustomCodeUpgradeFrom "3.5.3.0" $1
  8. ${If} $1 == 2
  9. ;Preserve existing fonts
  10. CreateDirectory "$INSTDIR\Data\"
  11. Rename "$INSTDIR\App\libreoffice\Basis\share\fonts\truetype" "$INSTDIR\Data\fonts"
  12. ;Remove LibreOffice defaults so no duplicates
  13. Delete "$INSTDIR\Data\fonts\DejaVuSans.ttf"
  14. Delete "$INSTDIR\Data\fonts\DejaVuSansCondensed.ttf"
  15. Delete "$INSTDIR\Data\fonts\DejaVuSansCondensed_Bold.ttf"
  16. Delete "$INSTDIR\Data\fonts\DejaVuSansCondensed_BoldOblique.ttf"
  17. Delete "$INSTDIR\Data\fonts\DejaVuSansCondensed_Oblique.ttf"
  18. Delete "$INSTDIR\Data\fonts\DejaVuSansMono.ttf"
  19. Delete "$INSTDIR\Data\fonts\DejaVuSansMono_Bold.ttf"
  20. Delete "$INSTDIR\Data\fonts\DejaVuSansMono_BoldOblique.ttf"
  21. Delete "$INSTDIR\Data\fonts\DejaVuSansMono_Oblique.ttf"
  22. Delete "$INSTDIR\Data\fonts\DejaVuSans_Bold.ttf"
  23. Delete "$INSTDIR\Data\fonts\DejaVuSans_BoldOblique.ttf"
  24. Delete "$INSTDIR\Data\fonts\DejaVuSans_ExtraLight.ttf"
  25. Delete "$INSTDIR\Data\fonts\DejaVuSans_Oblique.ttf"
  26. Delete "$INSTDIR\Data\fonts\DejaVuSerif.ttf"
  27. Delete "$INSTDIR\Data\fonts\DejaVuSerifCondensed.ttf"
  28. Delete "$INSTDIR\Data\fonts\DejaVuSerifCondensed_Bold.ttf"
  29. Delete "$INSTDIR\Data\fonts\DejaVuSerifCondensed_BoldItalic.ttf"
  30. Delete "$INSTDIR\Data\fonts\DejaVuSerifCondensed_Italic.ttf"
  31. Delete "$INSTDIR\Data\fonts\DejaVuSerif_Bold.ttf"
  32. Delete "$INSTDIR\Data\fonts\DejaVuSerif_BoldItalic.ttf"
  33. Delete "$INSTDIR\Data\fonts\DejaVuSerif_Italic.ttf"
  34. Delete "$INSTDIR\Data\fonts\GenBasB.ttf"
  35. Delete "$INSTDIR\Data\fonts\GenBasBI.ttf"
  36. Delete "$INSTDIR\Data\fonts\GenBasI.ttf"
  37. Delete "$INSTDIR\Data\fonts\GenBasR.ttf"
  38. Delete "$INSTDIR\Data\fonts\GenBkBasB.ttf"
  39. Delete "$INSTDIR\Data\fonts\GenBkBasBI.ttf"
  40. Delete "$INSTDIR\Data\fonts\GenBkBasI.ttf"
  41. Delete "$INSTDIR\Data\fonts\GenBkBasR.ttf"
  42. Delete "$INSTDIR\Data\fonts\LiberationMono_Bold.ttf"
  43. Delete "$INSTDIR\Data\fonts\LiberationMono_BoldItalic.ttf"
  44. Delete "$INSTDIR\Data\fonts\LiberationMono_Italic.ttf"
  45. Delete "$INSTDIR\Data\fonts\LiberationMono_Regular.ttf"
  46. Delete "$INSTDIR\Data\fonts\LiberationSansNarrow_Bold.ttf"
  47. Delete "$INSTDIR\Data\fonts\LiberationSansNarrow_BoldItalic.ttf"
  48. Delete "$INSTDIR\Data\fonts\LiberationSansNarrow_Italic.ttf"
  49. Delete "$INSTDIR\Data\fonts\LiberationSansNarrow_Regular.ttf"
  50. Delete "$INSTDIR\Data\fonts\LiberationSans_Bold.ttf"
  51. Delete "$INSTDIR\Data\fonts\LiberationSans_BoldItalic.ttf"
  52. Delete "$INSTDIR\Data\fonts\LiberationSans_Italic.ttf"
  53. Delete "$INSTDIR\Data\fonts\LiberationSans_Regular.ttf"
  54. Delete "$INSTDIR\Data\fonts\LiberationSerif_Bold.ttf"
  55. Delete "$INSTDIR\Data\fonts\LiberationSerif_BoldItalic.ttf"
  56. Delete "$INSTDIR\Data\fonts\LiberationSerif_Italic.ttf"
  57. Delete "$INSTDIR\Data\fonts\LiberationSerif_Regular.ttf"
  58. Delete "$INSTDIR\Data\fonts\LinBiolinum_RB_G.ttf"
  59. Delete "$INSTDIR\Data\fonts\LinBiolinum_RI_G.ttf"
  60. Delete "$INSTDIR\Data\fonts\LinBiolinum_R_G.ttf"
  61. Delete "$INSTDIR\Data\fonts\LinLibertine_RBI_G.ttf"
  62. Delete "$INSTDIR\Data\fonts\LinLibertine_RB_G.ttf"
  63. Delete "$INSTDIR\Data\fonts\LinLibertine_RI_G.ttf"
  64. Delete "$INSTDIR\Data\fonts\LinLibertine_RZI_G.ttf"
  65. Delete "$INSTDIR\Data\fonts\LinLibertine_RZ_G.ttf"
  66. Delete "$INSTDIR\Data\fonts\LinLibertine_R_G.ttf"
  67. Delete "$INSTDIR\Data\fonts\opens___.ttf"
  68. ${EndIf}
  69. ${EndIf}
  70. !macroend
  71. !macro CustomCodePostInstall
  72. ;Reset fontnames
  73. ${If} ${FileExists} "$INSTDIR\Data\settings\user\config\fontnames.dat"
  74. Delete "$INSTDIR\Data\settings\user\config\fontnames.dat"
  75. CopyFiles /SILENT "$INSTDIR\App\DefaultData\settings\user\config\fontnames.dat" "$INSTDIR\Data\settings\user\config"
  76. ${EndIf}
  77. ;Change installer languages into LibreOffice language code
  78. StrCpy $1 "NotDone"
  79. ${If} $LANGUAGE == "1078" ;Afrikaans
  80. StrCpy $1 "af"
  81. ${EndIf}
  82. ${If} $LANGUAGE == "1025" ;Arabic
  83. StrCpy $1 "ar"
  84. ${EndIf}
  85. ${If} $LANGUAGE == "1093" ;Bengali
  86. StrCpy $1 "bn"
  87. ${EndIf}
  88. ${If} $LANGUAGE == "1059" ;Belarussian
  89. StrCpy $1 "be"
  90. ${EndIf}
  91. ${If} $LANGUAGE == "1026" ;Bulgarian
  92. StrCpy $1 "bg"
  93. ${EndIf}
  94. ${If} $LANGUAGE == "1027" ;Catalan
  95. StrCpy $1 "ca"
  96. ${EndIf}
  97. ${If} $LANGUAGE == "1029" ;Czech
  98. StrCpy $1 "cs"
  99. ${EndIf}
  100. ${If} $LANGUAGE == "1030" ;Danish
  101. StrCpy $1 "da"
  102. ${EndIf}
  103. ${If} $LANGUAGE == "1031" ;German
  104. StrCpy $1 "de"
  105. ${EndIf}
  106. ${If} $LANGUAGE == "1032" ;Greek
  107. StrCpy $1 "el"
  108. ${EndIf}
  109. ${If} $LANGUAGE == "1034" ;Spanish
  110. StrCpy $1 "es"
  111. ${EndIf}
  112. ${If} $LANGUAGE == "3082" ;SpanishInternational (same as Spanish)
  113. StrCpy $1 "es"
  114. ${EndIf}
  115. ${If} $LANGUAGE == "1061" ;Estonian
  116. StrCpy $1 "et"
  117. ${EndIf}
  118. ${If} $LANGUAGE == "1035" ;Finnish
  119. StrCpy $1 "fi"
  120. ${EndIf}
  121. ${If} $LANGUAGE == "1036" ;French
  122. StrCpy $1 "fr"
  123. ${EndIf}
  124. ${If} $LANGUAGE == "1084" ;Gaelic
  125. StrCpy $1 "gd"
  126. ${EndIf}
  127. ${If} $LANGUAGE == "1110" ;Galician
  128. StrCpy $1 "gl"
  129. ${EndIf}
  130. ${If} $LANGUAGE == "1095" ;Gujarati
  131. StrCpy $1 "gu"
  132. ${EndIf}
  133. ${If} $LANGUAGE == "1037" ;Hebrew
  134. StrCpy $1 "he"
  135. ${EndIf}
  136. ${If} $LANGUAGE == "1050" ;Croatian
  137. StrCpy $1 "hr"
  138. ${EndIf}
  139. ${If} $LANGUAGE == "1081" ;Hindi
  140. StrCpy $1 "hi"
  141. ${EndIf}
  142. ${If} $LANGUAGE == "1038" ;Hungarian
  143. StrCpy $1 "hu"
  144. ${EndIf}
  145. ${If} $LANGUAGE == "1040" ;Italian
  146. StrCpy $1 "it"
  147. ${EndIf}
  148. ${If} $LANGUAGE == "1041" ;Japanese
  149. StrCpy $1 "ja"
  150. ${EndIf}
  151. ${If} $LANGUAGE == "1035" ;Finnish
  152. StrCpy $1 "fi"
  153. ${EndIf}
  154. ${If} $LANGUAGE == "1042" ;Korean
  155. StrCpy $1 "ko"
  156. ${EndIf}
  157. ${If} $LANGUAGE == "1063" ;Lithuanian
  158. StrCpy $1 "lt"
  159. ${EndIf}
  160. ${If} $LANGUAGE == "1062" ;Latvian
  161. StrCpy $1 "lv"
  162. ${EndIf}
  163. ${If} $LANGUAGE == "1121" ;Nepali
  164. StrCpy $1 "ne"
  165. ${EndIf}
  166. ${If} $LANGUAGE == "1043" ;Dutch
  167. StrCpy $1 "nl"
  168. ${EndIf}
  169. ${If} $LANGUAGE == "1044" ;Norwegian
  170. ${OrIf} $LANGUAGE == "2068" ;Norwegian
  171. StrCpy $1 "no"
  172. ${EndIf}
  173. ${If} $LANGUAGE == "1045" ;Polish
  174. StrCpy $1 "pl"
  175. ${EndIf}
  176. ${If} $LANGUAGE == "2070" ;Portuguese
  177. StrCpy $1 "pt"
  178. ${EndIf}
  179. ${If} $LANGUAGE == "1046" ;PortugueseBR
  180. StrCpy $1 "pt-BR"
  181. ${EndIf}
  182. ${If} $LANGUAGE == "1048" ;Romanian
  183. StrCpy $1 "ro"
  184. ${EndIf}
  185. ${If} $LANGUAGE == "1049" ;Russian
  186. StrCpy $1 "ru"
  187. ${EndIf}
  188. ${If} $LANGUAGE == "1051" ;Slovak
  189. StrCpy $1 "sk"
  190. ${EndIf}
  191. ${If} $LANGUAGE == "1060" ;Slovenian
  192. StrCpy $1 "sl"
  193. ${EndIf}
  194. ${If} $LANGUAGE == "3098" ;Serbian
  195. StrCpy $1 "sr"
  196. ${EndIf}
  197. ${If} $LANGUAGE == "2074" ;SerbianLatin
  198. StrCpy $1 "sh"
  199. ${EndIf}
  200. ${If} $LANGUAGE == "1115" ;Sinhalese
  201. StrCpy $1 "si"
  202. ${EndIf}
  203. ${If} $LANGUAGE == "1053" ;Swedish
  204. StrCpy $1 "sv"
  205. ${EndIf}
  206. ${If} $LANGUAGE == "1098" ;Teluga
  207. StrCpy $1 "te"
  208. ${EndIf}
  209. ${If} $LANGUAGE == "1054" ;Thai
  210. StrCpy $1 "th"
  211. ${EndIf}
  212. ${If} $LANGUAGE == "1055" ;Turkish
  213. StrCpy $1 "tr"
  214. ${EndIf}
  215. ${If} $LANGUAGE == "1058" ;Ukrainian
  216. StrCpy $1 "uk"
  217. ${EndIf}
  218. ${If} $LANGUAGE == "1066" ;Vietnamese
  219. StrCpy $1 "vi"
  220. ${EndIf}
  221. ${If} $LANGUAGE == "2052" ;SimpChinese
  222. StrCpy $1 "zh-CN"
  223. ${EndIf}
  224. ${If} $LANGUAGE == "1028" ;TradChinese
  225. StrCpy $1 "zh-TW"
  226. ${EndIf}
  227. ${If} $LANGUAGE == "1077" ;Zulu
  228. StrCpy $1 "zu"
  229. ${EndIf}
  230. ${If} $LANGUAGE == "2057" ;EnglishGB
  231. StrCpy $1 "en-GB"
  232. ${EndIf}
  233. ${If} $1 == "NotDone" ;Fallback to English
  234. StrCpy $1 "en-US"
  235. ${EndIf}
  236. ;If xcu doesn't exist, create it from scratch and add the language selection
  237. ${IfNot} ${FileExists} "$INSTDIR\Data\settings\user\registrymodifications.xcu"
  238. WriteINIStr "$INSTDIR\App\libreoffice\program\soffice.ini" "Bootstrap" "STARTLANG" "$0"
  239. CreateDirectory "$INSTDIR\Data"
  240. CopyFiles /SILENT "$INSTDIR\App\DefaultData\*.*" "$INSTDIR\Data"
  241. CreateDirectory "$INSTDIR\Data\temp"
  242. Delete "$INSTDIR\Data\settings\user\registrymodifications.xcu"
  243. FileOpen $0 "$INSTDIR\Data\settings\user\registrymodifications.xcu" w
  244. FileWrite $0 `<?xml version="1.0" encoding="UTF-8"?>`
  245. FileWrite $0 `<oor:items xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">`
  246. FileWrite $0 `<item oor:path="/org.openoffice.Office.Common/Help"><prop oor:name="ExtendedTip" oor:op="fuse"><value>false</value></prop></item>`
  247. FileWrite $0 `<item oor:path="/org.openoffice.Office.Common/Help"><prop oor:name="Locale" oor:op="fuse"><value></value></prop></item>`
  248. FileWrite $0 `<item oor:path="/org.openoffice.Office.Common/Help"><prop oor:name="System" oor:op="fuse"><value>WIN</value></prop></item>`
  249. FileWrite $0 `<item oor:path="/org.openoffice.Office.Common/Internal"><prop oor:name="CurrentTempURL" oor:op="fuse"><value></value></prop></item>`
  250. FileWrite $0 `<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="FirstRun" oor:op="fuse"><value>false</value></prop></item>`
  251. FileWrite $0 `<item oor:path="/org.openoffice.Office.Common/Path/Current"><prop oor:name="Temp" oor:op="fuse"><value xsi:nil="true"/></prop></item>`
  252. FileWrite $0 `<item oor:path="/org.openoffice.Office.Common/Path/Current"><prop oor:name="Temp" oor:op="fuse"><value xsi:nil="true"/></prop></item>`
  253. FileWrite $0 `<item oor:path="/org.openoffice.Office.Common/Path/Current"><prop oor:name="Work" oor:op="fuse"><value xsi:nil="true"/></prop></item>`
  254. FileWrite $0 `<item oor:path="/org.openoffice.Office.Common/Path/Info"><prop oor:name="WorkPathChanged" oor:op="fuse"><value>true</value></prop></item>`
  255. FileWrite $0 `<item oor:path="/org.openoffice.Office.Linguistic/General"><prop oor:name="UILocale" oor:op="fuse"><value>$1</value></prop></item>`
  256. FileWrite $0 `<item oor:path="/org.openoffice.Office.Paths/Paths/org.openoffice.Office.Paths:NamedPath['Temp']"><prop oor:name="WritePath" oor:op="fuse"><value>file:///Z:/Temp</value></prop></item>`
  257. FileWrite $0 `<item oor:path="/org.openoffice.Office.Paths/Paths/org.openoffice.Office.Paths:NamedPath['Work']"><prop oor:name="WritePath" oor:op="fuse"><value>DEFAULT--WORK--PATH</value></prop></item>`
  258. FileWrite $0 `<item oor:path="/org.openoffice.Setup/L10N"><prop oor:name="ooLocale" oor:op="fuse"><value>$1</value></prop></item>`
  259. FileWrite $0 `<item oor:path="/org.openoffice.Setup/Office/Factories/org.openoffice.Setup:Factory['com.sun.star.frame.StartModule']"><prop oor:name="ooSetupFactoryWindowAttributes" oor:op="fuse"><value>83,105,1424,722;1;1;0,0,0,0;</value></prop></item>`
  260. FileWrite $0 `<item oor:path="/org.openoffice.Setup/Office"><prop oor:name="LastCompatibilityCheckID" oor:op="fuse"><value>330m19(Build:202)</value></prop></item>`
  261. FileWrite $0 `<item oor:path="/org.openoffice.Setup/Office"><prop oor:name="ooSetupInstCompleted" oor:op="fuse"><value>true</value></prop></item>`
  262. FileWrite $0 `<item oor:path="/org.openoffice.Office.Writer/Layout/Other"><prop oor:name="ApplyCharUnit" oor:op="fuse"><value>false</value></prop></item>`
  263. ${If} $1 == "de"
  264. FileWrite $0 `<item oor:path="/org.openoffice.Setup/L10N"><prop oor:name="ooSetupSystemLocale" oor:op="fuse"><value>de-DE</value></prop></item>`
  265. ${ElseIf} $1 == "it"
  266. FileWrite $0 `<item oor:path="/org.openoffice.Setup/L10N"><prop oor:name="ooSetupSystemLocale" oor:op="fuse"><value>it-IT</value></prop></item>`
  267. ${ElseIf} $1 == "fr"
  268. FileWrite $0 `<item oor:path="/org.openoffice.Setup/L10N"><prop oor:name="ooSetupSystemLocale" oor:op="fuse"><value>fr-FR</value></prop></item>`
  269. ${ElseIf} $1 == "ar"
  270. FileWrite $0 `<item oor:path="/org.openoffice.Setup/L10N"><prop oor:name="ooSetupSystemLocale" oor:op="fuse"><value>ar-SA</value></prop></item>`
  271. ${ElseIf} $1 == "nl"
  272. FileWrite $0 `<item oor:path="/org.openoffice.Setup/L10N"><prop oor:name="ooSetupSystemLocale" oor:op="fuse"><value>nl-NL</value></prop></item>`
  273. ${ElseIf} $1 == "es"
  274. FileWrite $0 `<item oor:path="/org.openoffice.Setup/L10N"><prop oor:name="ooSetupSystemLocale" oor:op="fuse"><value>es-AR</value></prop></item>`
  275. ${ElseIf} $1 == "sv"
  276. FileWrite $0 `<item oor:path="/org.openoffice.Setup/L10N"><prop oor:name="ooSetupSystemLocale" oor:op="fuse"><value>sv-SE</value></prop></item>`
  277. ${ElseIf} $1 == "sr"
  278. FileWrite $0 `<item oor:path="/org.openoffice.Setup/L10N"><prop oor:name="ooSetupSystemLocale" oor:op="fuse"><value>sr-RS</value></prop></item>`
  279. ${ElseIf} $1 == "sh"
  280. FileWrite $0 `<item oor:path="/org.openoffice.Setup/L10N"><prop oor:name="ooSetupSystemLocale" oor:op="fuse"><value>sh-RS</value></prop></item>`
  281. ${Else}
  282. FileWrite $0 `<item oor:path="/org.openoffice.Setup/L10N"><prop oor:name="ooSetupSystemLocale" oor:op="fuse"><value>$1</value></prop></item>`
  283. ${EndIf}
  284. FileWrite $0 `</oor:items>`
  285. ;FileWrite $0 `<item oor:path="/org.openoffice.Office.Common/Path/Current"><prop oor:name="Backup" oor:op="fuse"><value xsi:nil="true"/></prop></item>`
  286. ;FileWeite $0 `<item oor:path="/org.openoffice.Office.Paths/Paths/org.openoffice.Office.Paths:NamedPath['Backup']"><prop oor:name="WritePath" oor:op="fuse"><value>file:///P:/PortableApps/LibreOffice/Data/backups</value></prop></item>`
  287. ;FileWrite $0 `<item oor:path="/org.openoffice.Setup/Office/Factories/org.openoffice.Setup:Factory['com.sun.star.frame.StartModule']"><prop oor:name="ooSetupFactoryWindowAttributes" oor:op="fuse"><value>83,105,1424,722;1;0,0,0,0;</value></prop></item><item oor:path="/org.openoffice.Setup/Office"><prop oor:name="LastCompatibilityCheckID" oor:op="fuse"><value>330m19(Build:8)</value></prop></item><item oor:path="/org.openoffice.Setup/Office"><prop oor:name="OfficeRestartInProgress" oor:op="fuse"><value>false</value></prop></item><item oor:path="/org.openoffice.Setup/Office"><prop oor:name="ooSetupInstCompleted" oor:op="fuse"><value>true</value></prop></item></oor:items>`
  288. FileClose $0
  289. ${EndIf}
  290. ;See if the user selected to remove additional languages
  291. SectionGetFlags ${OPTIONALSECTIONIDX} $0
  292. IntOp $0 $0 & ${SF_SELECTED}
  293. ${If} $0 >= ${SF_SELECTED}
  294. ;Remove dictionaries
  295. Rename "$INSTDIR\App\libreoffice\share\extensions\dict-$1" "$INSTDIR\App\libreoffice\share\extensions\keep-$1"
  296. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-af"
  297. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-an"
  298. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-ar"
  299. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-be"
  300. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-bg"
  301. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-bn"
  302. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-br"
  303. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-ca"
  304. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-cs"
  305. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-da"
  306. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-de"
  307. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-el"
  308. ;RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-en" - Don't remove English
  309. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-es"
  310. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-et"
  311. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-fr"
  312. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-gd"
  313. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-gl"
  314. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-gu"
  315. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-he"
  316. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-hi"
  317. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-hr"
  318. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-hu"
  319. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-it"
  320. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-ku-TR"
  321. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-lt"
  322. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-lv"
  323. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-ne"
  324. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-nl"
  325. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-no"
  326. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-oc"
  327. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-pl"
  328. ${If} $1 != "pt" ;Keep alternate dictionaries
  329. ${AndIf} $1 != "pt-BR" ;Keep alternate dictionaries
  330. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-pt"
  331. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-pt-BR"
  332. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-pt-PT"
  333. ${EndIf}
  334. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-ro"
  335. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-ru"
  336. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-si"
  337. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-sk"
  338. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-sl"
  339. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-sr"
  340. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-sv"
  341. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-te"
  342. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-th"
  343. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-uk"
  344. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-vi"
  345. RMDir /r "$INSTDIR\App\libreoffice\share\extensions\dict-zu"
  346. Rename "$INSTDIR\App\libreoffice\share\extensions\keep-$1" "$INSTDIR\App\libreoffice\share\extensions\dict-$1"
  347. ;Resources
  348. Rename "$INSTDIR\App\libreoffice\program\resource" "$INSTDIR\App\libreoffice\program\resource-delete"
  349. CreateDirectory "$INSTDIR\App\libreoffice\program\resource"
  350. Rename "$INSTDIR\App\libreoffice\program\resource-delete\en_GB" "$INSTDIR\App\libreoffice\program\resource\en_GB"
  351. Rename "$INSTDIR\App\libreoffice\program\resource-delete\en_US" "$INSTDIR\App\libreoffice\program\resource\en_US"
  352. Rename "$INSTDIR\App\libreoffice\program\resource-delete\en_ZA" "$INSTDIR\App\libreoffice\program\resource\en_ZA"
  353. Rename "$INSTDIR\App\libreoffice\program\resource-delete\$1" "$INSTDIR\App\libreoffice\program\resource\$1"
  354. Rename "$INSTDIR\App\libreoffice\program\resource-delete\$1_BR.res" "$INSTDIR\App\libreoffice\program\resource\$1_BR.res"
  355. Rename "$INSTDIR\App\libreoffice\program\resource-delete\$1_ZA.res" "$INSTDIR\App\libreoffice\program\resource\$1_ZA.res"
  356. Rename "$INSTDIR\App\libreoffice\program\resource-delete\$1_XV.res" "$INSTDIR\App\libreoffice\program\resource\$1_XV.res"
  357. Rename "$INSTDIR\App\libreoffice\program\resource-delete\$1_IN.res" "$INSTDIR\App\libreoffice\program\resource\$1_IN.res"
  358. Rename "$INSTDIR\App\libreoffice\program\resource-delete\$1_TZ.res" "$INSTDIR\App\libreoffice\program\resource\$1_TZ.res"
  359. RMDir /r "$INSTDIR\App\libreoffice\program\resource-delete"
  360. ;Remove the autotext entries
  361. CreateDirectory "$INSTDIR\App\libreoffice\share\autotextkeep"
  362. Rename "$INSTDIR\App\libreoffice\share\autotext\$1" "$INSTDIR\App\libreoffice\share\autotextkeep\$1"
  363. Rename "$INSTDIR\App\libreoffice\share\autotext\$1-XV" "$INSTDIR\App\libreoffice\share\autotextkeep\$1-XV"
  364. Rename "$INSTDIR\App\libreoffice\share\autotext\en-GB" "$INSTDIR\App\libreoffice\share\autotextkeep\en-GB"
  365. Rename "$INSTDIR\App\libreoffice\share\autotext\en-US" "$INSTDIR\App\libreoffice\share\autotextkeep\en-US"
  366. Rename "$INSTDIR\App\libreoffice\share\autotext\en-ZA" "$INSTDIR\App\libreoffice\share\autotextkeep\en-ZA"
  367. RMDir /r "$INSTDIR\App\libreoffice\share\autotext"
  368. Rename "$INSTDIR\App\libreoffice\share\autotextkeep" "$INSTDIR\App\libreoffice\share\autotext"
  369. ;Remove the regsitry entries
  370. Rename "$INSTDIR\App\libreoffice\share\registry\res\registry_$1.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_$1.xcd"
  371. Rename "$INSTDIR\App\libreoffice\share\registry\res\registry_$1-XV.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-XV.xcd"
  372. Rename "$INSTDIR\App\libreoffice\share\registry\res\registry_$1-IN.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-IN.xcd"
  373. Rename "$INSTDIR\App\libreoffice\share\registry\res\registry_$1-Latn.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-Latn.xcd"
  374. Rename "$INSTDIR\App\libreoffice\share\registry\res\registry_$1-TZ.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-TZ.xcd"
  375. Rename "$INSTDIR\App\libreoffice\share\registry\res\registry_en-US.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_en-US.xcd"
  376. Rename "$INSTDIR\App\libreoffice\share\registry\res\registry_en-GB.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_en-GB.xcd"
  377. Rename "$INSTDIR\App\libreoffice\share\registry\res\registry_en-ZA.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_en-ZA.xcd"
  378. ;Temporary hack to fix the bug with Base showing non-English titlebar text
  379. Rename "$INSTDIR\App\libreoffice\share\registry\registry_zu.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_zu.xcd"
  380. Delete "$INSTDIR\App\libreoffice\share\registry\res\registry_*.xcd"
  381. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_en-US.xcd" "$INSTDIR\App\libreoffice\share\registry\res\registry_en-US.xcd"
  382. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_en-GB.xcd" "$INSTDIR\App\libreoffice\share\registry\res\registry_en-GB.xcd"
  383. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_en-ZA.xcd" "$INSTDIR\App\libreoffice\share\registry\res\registry_en-ZA.xcd"
  384. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_$1.xcd" "$INSTDIR\App\libreoffice\share\registry\res\registry_$1.xcd"
  385. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-XV.xcd" "$INSTDIR\App\libreoffice\share\registry\res\registry_$1-XV.xcd"
  386. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-IN.xcd" "$INSTDIR\App\libreoffice\share\registry\res\registry_$1-IN.xcd"
  387. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-Latn.xcd" "$INSTDIR\App\libreoffice\share\registry\res\registry_$1-Latn.xcd"
  388. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-TZ.xcd" "$INSTDIR\App\libreoffice\share\registry\res\registry_$1-TZ.xcd"
  389. ;Temporary hack to fix the bug with Base showing non-English titlebar text
  390. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_zu.xcd" "$INSTDIR\App\libreoffice\share\registry\registry_zu.xcd"
  391. Rename "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_$1.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_$1.xcd"
  392. Rename "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_$1-XV.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-XV.xcd"
  393. Rename "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_$1-IN.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-IN.xcd"
  394. Rename "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_$1-Latn.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-Latn.xcd"
  395. Rename "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_$1-TZ.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-TZ.xcd"
  396. Rename "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_en-US.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_en-US.xcd"
  397. Rename "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_en-GB.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_en-GB.xcd"
  398. Rename "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_en-ZA.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_en-ZA.xcd"
  399. ;Temporary hack to fix the bug with Base showing non-English titlebar text
  400. Rename "$INSTDIR\App\libreoffice\share\registry\registry_zu.xcd" "$INSTDIR\App\libreoffice\share\registry\res\keep_zu.xcd"
  401. Delete "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_*.xcd"
  402. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_en-US.xcd" "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_en-US.xcd"
  403. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_en-GB.xcd" "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_en-GB.xcd"
  404. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_en-ZA.xcd" "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_en-ZA.xcd"
  405. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_$1.xcd" "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_$1.xcd"
  406. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-XV.xcd" "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_$1-XV.xcd"
  407. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-IN.xcd" "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_$1-IN.xcd"
  408. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-Latn.xcd" "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_$1-Latn.xcd"
  409. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_$1-TZ.xcd" "$INSTDIR\App\libreoffice\share\registry\res\fcfg_langpack_$1-TZ.xcd"
  410. ;Temporary hack to fix the bug with Base showing non-English titlebar text
  411. Rename "$INSTDIR\App\libreoffice\share\registry\res\keep_zu.xcd" "$INSTDIR\App\libreoffice\share\registry\registry_zu.xcd"
  412. ;Remove the langpacks
  413. Rename "$INSTDIR\App\libreoffice\share\registry\Langpack-$1.xcd" "$INSTDIR\App\libreoffice\share\registry\keep-$1.xcd"
  414. Rename "$INSTDIR\App\libreoffice\share\registry\Langpack-$1-XV.xcd" "$INSTDIR\App\libreoffice\share\registry\keep-$1-XV.xcd"
  415. Rename "$INSTDIR\App\libreoffice\share\registry\Langpack-$1-IN.xcd" "$INSTDIR\App\libreoffice\share\registry\keep-$1-IN.xcd"
  416. Rename "$INSTDIR\App\libreoffice\share\registry\Langpack-$1-Latn.xcd" "$INSTDIR\App\libreoffice\share\registry\keep-$1-Latn.xcd"
  417. Rename "$INSTDIR\App\libreoffice\share\registry\Langpack-$1-TZ.xcd" "$INSTDIR\App\libreoffice\share\registry\keep-$1-TZ.xcd"
  418. Rename "$INSTDIR\App\libreoffice\share\registry\Langpack-en-US.xcd" "$INSTDIR\App\libreoffice\share\registry\keep-en-US.xcd"
  419. Rename "$INSTDIR\App\libreoffice\share\registry\Langpack-en-GB.xcd" "$INSTDIR\App\libreoffice\share\registry\keep-en-GB.xcd"
  420. Rename "$INSTDIR\App\libreoffice\share\registry\Langpack-en-ZA.xcd" "$INSTDIR\App\libreoffice\share\registry\keep-en-ZA.xcd"
  421. ;Temporary hack to fix the bug with Base showing non-English titlebar text
  422. Rename "$INSTDIR\App\libreoffice\share\registry\registry_zu.xcd" "$INSTDIR\App\libreoffice\share\registry\keep-zu.xcd"
  423. Delete "$INSTDIR\App\libreoffice\share\registry\Langpack-*.xcd"
  424. Rename "$INSTDIR\App\libreoffice\share\registry\keep-en-US.xcd" "$INSTDIR\App\libreoffice\share\registry\Langpack-en-US.xcd"
  425. Rename "$INSTDIR\App\libreoffice\share\registry\keep-en-GB.xcd" "$INSTDIR\App\libreoffice\share\registry\Langpack-en-GB.xcd"
  426. Rename "$INSTDIR\App\libreoffice\share\registry\keep-en-ZA.xcd" "$INSTDIR\App\libreoffice\share\registry\Langpack-en-ZA.xcd"
  427. Rename "$INSTDIR\App\libreoffice\share\registry\keep-$1.xcd" "$INSTDIR\App\libreoffice\share\registry\Langpack-$1.xcd"
  428. Rename "$INSTDIR\App\libreoffice\share\registry\keep-$1-XV.xcd" "$INSTDIR\App\libreoffice\share\registry\Langpack-$1-XV.xcd"
  429. Rename "$INSTDIR\App\libreoffice\share\registry\keep-$1-IN.xcd" "$INSTDIR\App\libreoffice\share\registry\Langpack-$1-IN.xcd"
  430. Rename "$INSTDIR\App\libreoffice\share\registry\keep-$1-Latn.xcd" "$INSTDIR\App\libreoffice\share\registry\Langpack-$1-Latn.xcd"
  431. Rename "$INSTDIR\App\libreoffice\share\registry\keep-$1-TZ.xcd" "$INSTDIR\App\libreoffice\share\registry\Langpack-$1-TZ.xcd"
  432. ;Temporary hack to fix the bug with Base showing non-English titlebar text
  433. Rename "$INSTDIR\App\libreoffice\share\registry\keep-zu.xcd" "$INSTDIR\App\libreoffice\share\registry\registry_zu.xcd"
  434. ;Remove the templates
  435. ;CreateDirectory "$INSTDIR\App\libreoffice\share\templatekeep"
  436. ;Rename "$INSTDIR\App\libreoffice\share\template\layout" "$INSTDIR\App\libreoffice\share\templatekeep\layout"
  437. ;Rename "$INSTDIR\App\libreoffice\share\template\wizard" "$INSTDIR\App\libreoffice\share\templatekeep\wizard"
  438. ;Rename "$INSTDIR\App\libreoffice\share\template\$1" "$INSTDIR\App\libreoffice\share\templatekeep\$1"
  439. ;Rename "$INSTDIR\App\libreoffice\share\template\en-GB" "$INSTDIR\App\libreoffice\share\templatekeep\en-GB"
  440. ;Rename "$INSTDIR\App\libreoffice\share\template\en-US" "$INSTDIR\App\libreoffice\share\templatekeep\en-US"
  441. ;RMDir /r "$INSTDIR\App\libreoffice\share\template"
  442. ;Rename "$INSTDIR\App\libreoffice\share\templatekeep" "$INSTDIR\App\libreoffice\share\template"
  443. ;Remove the wordbooks
  444. ;CreateDirectory "$INSTDIR\App\libreoffice\share\wordbookkeep"
  445. ;Rename "$INSTDIR\App\libreoffice\share\wordbook\$1" "$INSTDIR\App\libreoffice\share\wordbookkeep\$1"
  446. ;Rename "$INSTDIR\App\libreoffice\share\wordbook\$1-XV" "$INSTDIR\App\libreoffice\share\wordbookkeep\$1-XV"
  447. ;Rename "$INSTDIR\App\libreoffice\share\wordbook\en-GB" "$INSTDIR\App\libreoffice\share\wordbookkeep\en-GB"
  448. ;Rename "$INSTDIR\App\libreoffice\share\wordbook\en-US" "$INSTDIR\App\libreoffice\share\wordbookkeep\en-US"
  449. ;RMDir /r "$INSTDIR\App\libreoffice\share\wordbook"
  450. ;Rename "$INSTDIR\App\libreoffice\share\wordbookkeep" "$INSTDIR\App\libreoffice\share\wordbook"
  451. ;Remove the readme files
  452. Rename "$INSTDIR\App\libreoffice\readmes\readme_$1.txt" "$INSTDIR\App\libreoffice\readmes\keep_$1.txt"
  453. Rename "$INSTDIR\App\libreoffice\readmes\readme_$1-XV.txt" "$INSTDIR\App\libreoffice\readmes\keep_$1-XV.txt"
  454. Rename "$INSTDIR\App\libreoffice\readmes\readme_en-US.txt" "$INSTDIR\App\libreoffice\readmes\keep_en-US.txt"
  455. Rename "$INSTDIR\App\libreoffice\readmes\readme_en-GB.txt" "$INSTDIR\App\libreoffice\readmes\keep_en-GB.txt"
  456. Rename "$INSTDIR\App\libreoffice\readmes\readme_en-ZA.txt" "$INSTDIR\App\libreoffice\readmes\keep_en-ZA.txt"
  457. Delete "$INSTDIR\App\libreoffice\readmes\readme_*.txt"
  458. Rename "$INSTDIR\App\libreoffice\readmes\keep_en-US.txt" "$INSTDIR\App\libreoffice\readmes\readme_en-US.txt"
  459. Rename "$INSTDIR\App\libreoffice\readmes\keep_en-GB.txt" "$INSTDIR\App\libreoffice\readmes\readme_en-GB.txt"
  460. Rename "$INSTDIR\App\libreoffice\readmes\keep_en-ZA.txt" "$INSTDIR\App\libreoffice\readmes\readme_en-ZA.txt"
  461. Rename "$INSTDIR\App\libreoffice\readmes\keep_$1.txt" "$INSTDIR\App\libreoffice\readmes\readme_$1.txt"
  462. Rename "$INSTDIR\App\libreoffice\readmes\keep_$1-XV.txt" "$INSTDIR\App\libreoffice\readmes\readme_$1-XV.txt"
  463. ${If} $InstallerCustomCodeUpgradeFrom == ""
  464. StrCpy $InstallerCustomCodeUpgradeFrom "0.0.0.0"
  465. ${EndIf}
  466. ;Specific version that removed languages settings remains the same for
  467. ;${VersionCompare} $InstallerCustomCodeUpgradeFrom 3.5.3.0 $1
  468. ;${If} $1 == 2 ;Upgraded version number
  469. ;${OrIf} $InstallerCustomCodeUpgradeFromInstallType != "LanguagesRemoved"
  470. ;Start silently to rebuild the data settings
  471. ; ExecWait '"$INSTDIR\LibreOfficePortable.exe" -nologo'
  472. ;${EndIf}
  473. ;Only do a settings rebuild for fresh install
  474. ;${If} $InstallerCustomCodeUpgradeFromInstallType != "LanguagesRemoved"
  475. ;${AndIf} $InstallerCustomCodeUpgradeFrom == "0.0.0.0"
  476. ; ExecWait '"$INSTDIR\LibreOfficePortable.exe" -nologo'
  477. ;${EndIf}
  478. ${EndIf}
  479. !macroend