]> git.lyx.org Git - features.git/blobdiff - development/Win32/packaging/installer/include/init.nsh
Consider inset strings in simple find/replaceAll (#12049)
[features.git] / development / Win32 / packaging / installer / include / init.nsh
index 55f76445b66a80ee3a936c53db8098f0d4fdfc12..bdbb49525a35a8a95250f17fad2f9daf243c2e0d 100644 (file)
@@ -13,8 +13,8 @@ Var LyXLangName
 # COMPONENT can be LaTeX, ImageMagick and Ghostscript
 !macro EXTERNAL_INIT COMPONENT
 
-  # APP_REGKEY_SETUP = "Software\${APP_NAME}${APP_SERIES_KEY}\Setup"
-  # where ${APP_NAME}${APP_SERIES_KEY} is something like LyX22
+  # APP_REGKEY_SETUP = "Software\${APP_NAME}\${APP_SERIES_KEY}\Setup"
+  # where ${APP_NAME}\${APP_SERIES_KEY} is something like LyX\220
   ReadRegStr $ComponentPath SHELL_CONTEXT "${APP_REGKEY_SETUP}" "${COMPONENT} Path"
   
   # BIN_LATEX etc are defined in settings.nsh
@@ -44,16 +44,6 @@ FunctionEnd
 #--------------------------------
 # visible installer sections
 
-Section "!${APP_NAME}" SecCore
- SectionIn RO
- !if ${SETUPTYPE} == BUNDLE
-  # if no TeX was found MiKTeX will be installed which requires space
-  !if $PathLaTeX == ""
-   AddSize 1020000 # size in KB
-  !endif
- !endif
-SectionEnd
-
 Section "$(SecFileAssocTitle)" SecFileAssoc
  StrCpy $CreateFileAssociations "true" 
 SectionEnd
@@ -73,8 +63,8 @@ Section /o "Afrikaans" SecDAfrikaans
 SectionEnd
 
 Section /o "العربية" SecDArabic
- StrCpy $DictCodes "ar_DZ,$DictCodes"
- AddSize 2500
+ StrCpy $DictCodes "ar_SA,$DictCodes"
+ AddSize 7304
 SectionEnd
 
 Section /o "հայերեն" SecDArmenian
@@ -99,7 +89,7 @@ SectionEnd
 
 Section /o "Brezhoneg" SecDBreton 
  StrCpy $DictCodes "br_FR,$DictCodes"
- AddSize 5510
+ AddSize 5556
 SectionEnd
 
 Section /o "български" SecDBulgarian
@@ -161,19 +151,19 @@ SectionEnd
 
 Section /o "English (AU)" SecDEnglishAU
  StrCpy $DictCodes "en_AU,$DictCodes"
- AddSize 552
+ AddSize 557
 SectionEnd
 
 Section /o "English (CA)" SecDEnglishCA
  StrCpy $DictCodes "en_CA,$DictCodes"
- AddSize 550
+ AddSize 557
 SectionEnd
 
 Section "English (GB)" SecDEnglishGB
  # already installed by default
  SectionIn RO
  #StrCpy $DictCodes "en_GB,$DictCodes"
- AddSize 742
+ AddSize 1044
 SectionEnd
 
 Section /o "English (NZ)" SecDEnglishNZ
@@ -185,7 +175,7 @@ Section "English (US)" SecDEnglishUS
  # already installed by default
  SectionIn RO
  #StrCpy $DictCodes "en_US,$DictCodes"
- AddSize 548
+ AddSize 551
 SectionEnd
 
 Section "Español (ES)" SecDSpanishES
@@ -244,6 +234,11 @@ Section /o "Galego" SecDGalician
  AddSize 3911
 SectionEnd
 
+Section /o "ქართული ენა" SecDGeorgian
+ StrCpy $DictCodes "ka_GE,$DictCodes"
+ AddSize 3952
+SectionEnd
+
 Section /o "עִברִית" SecDHebrew
  StrCpy $DictCodes "he_IL,$DictCodes"
  AddSize 3120
@@ -416,7 +411,7 @@ SectionEnd
 
 Section /o "Türkmençe" SecDTurkmen
  StrCpy $DictCodes "tk_TM,$DictCodes"
- AddSize 950
+ AddSize 2797
 SectionEnd
 
 Section /o "Türkçe" SecDTurkish
@@ -426,7 +421,7 @@ SectionEnd
 
 Section /o "Українська" SecDUkrainian
  StrCpy $DictCodes "uk_UA,$DictCodes"
- AddSize 5555
+ AddSize 6905
 SectionEnd
 
 Section /o "اردو" SecDUrdu
@@ -444,6 +439,11 @@ SectionGroupEnd
 
 SectionGroup "$(SecThesaurus)" SecThesaurus
 
+Section /o "العربية" SecTArabic
+ StrCpy $ThesCodes "ar_SA,$ThesCodes"
+ AddSize 799
+SectionEnd
+
 Section /o "български" SecTBulgarian
  StrCpy $ThesCodes "bg_BG,$ThesCodes"
  AddSize 3020
@@ -583,7 +583,6 @@ SectionGroupEnd
 
 # Section descriptions
 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
-!insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
 !insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
@@ -595,6 +594,15 @@ SectionGroupEnd
 # the selection states of the dictionary sections
 Function .onInit
 
+  !if ${APP_VERSION_ACHITECHTURE} = 64
+    ${IfNot} ${RunningX64}
+      MessageBox MB_OK|MB_ICONSTOP "Cannot install a 64 bit app on 32 bit Windows, please use the 32 bit installer" /SD IDOK
+      Abort
+    ${EndIf}
+  !EndIf
+
+  SetRegView ${APP_VERSION_ACHITECHTURE}
+
   ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
   ${if} $R0 == "5.0" # 2000
   ${orif} $R0 == "5.1" # XP
@@ -604,22 +612,6 @@ Function .onInit
     Quit
   ${endif}
   
-  # check that another LyX installer is not currently running
-  !if ${SETUPTYPE} == STANDARD
-   FindProcDLL::FindProc "${BundleExeFile}"
-   ${if} $R0 == "1"
-    MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)" /SD IDOK
-    Abort
-   ${endif}
-  !endif
-  !if ${SETUPTYPE} == BUNDLE
-   FindProcDLL::FindProc "${ExeFile}"
-   ${if} $R0 == "1"
-    MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)" /SD IDOK
-    Abort
-   ${endif}
-  !endif
-  
   # Check that LyX is not currently running
   FindProcDLL::FindProc "${BIN_LYX}"
   ${if} $R0 == "1"
@@ -627,11 +619,6 @@ Function .onInit
    Abort
   ${endif}
   
-  # read the user and computer name
-  ReadRegStr $ComputerName HKLM "System\CurrentControlSet\Control\ComputerName\ActiveComputerName" "ComputerName"
-  System::Call "advapi32::GetUserName(t .r0, *i ${NSIS_MAX_STRLEN} r1) i.r2"
-  StrCpy $UserName $0
-  
   !insertmacro MULTIUSER_INIT
   
   # check if this LyX version is already installed
@@ -649,7 +636,7 @@ Function .onInit
    # check if the uninstaller was acidentally deleted
    # if so don't bother the user if he realy wants to install a new LyX over an existing one
    # because he won't have a chance to deny this
-   StrCpy $4 $0 -10 # remove '\bin\lyx,0'
+   StrCpy $4 $0 -12 # remove '\bin\lyx.exe'
    # (for FileCheck the variables $0 and $1 cannot be used)
    !insertmacro FileCheck $5 "Uninstall-${APP_NAME}.exe" "$4" # macro from LyXUtils.nsh
    ${if} $5 == "False"
@@ -673,13 +660,17 @@ Function .onInit
     ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
     # also check for an emergency release
     ${if} $0 == ""
-     ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
+     ${For} $7 0 20
+      ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5$7" "DisplayVersion"
+     ${Next}
     ${endif}
    ${else}
     ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
     # also check for an emergency release
     ${if} $0 == ""
-     ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
+     ${For} $7 0 20
+      ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5$7" "DisplayVersion"
+     ${Next}
     ${endif}
    ${endif}
    ${if} $0 != ""
@@ -709,13 +700,6 @@ Function .onInit
  
   Call SearchExternal
   
-  #!if ${SETUPTYPE} == BUNDLE
-  # # don't let the installer sections appear when the programs are already installed
-  # ${if} $PathBibTeXEditor != ""
-  #  SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
-  # ${endif}
-  #!endif
-  
   # select sections of already installed spell-checker dictionaries, make them read-only
   # and set the necessary size to 0 bytes
   StrCpy $String $FoundDict
@@ -726,7 +710,7 @@ Function .onInit
    SectionSetFlags ${SecDAfrikaans} $0
    SectionSetSize ${SecDAfrikaans} 0
   ${endif}
-  StrCpy $Search "ar_DZ"
+  StrCpy $Search "ar_SA"
   Call StrPoint
   ${if} $Pointer != "-1"
    IntOp $0 ${SF_SELECTED} | ${SF_RO}
@@ -951,6 +935,13 @@ Function .onInit
    SectionSetFlags ${SecDGalician} $0
    SectionSetSize ${SecDGalician} 0
   ${endif}
+  StrCpy $Search "ka_GE"
+  Call StrPoint
+  ${if} $Pointer != "-1"
+   IntOp $0 ${SF_SELECTED} | ${SF_RO}
+   SectionSetFlags ${SecDGeorgian} $0
+   SectionSetSize ${SecDGeorgian} 0
+  ${endif}
   StrCpy $Search "he_IL"
   Call StrPoint
   ${if} $Pointer != "-1"
@@ -1228,8 +1219,15 @@ Function .onInit
   # select sections of already installed thesaurus dictionaries, make them read-only
   # and set the necessary size to 0 bytes
   StrCpy $String $FoundThes
-  StrCpy $Search "bg_BG"
+  StrCpy $Search "ar_SA"
   Call StrPoint # function from LyXUtils.nsh
+  ${if} $Pointer != "-1"
+   IntOp $0 ${SF_SELECTED} | ${SF_RO}
+   SectionSetFlags ${SecTArabic} $0
+   SectionSetSize ${SecTArabic} 0
+  ${endif}
+  StrCpy $Search "bg_BG"
+  Call StrPoint
   ${if} $Pointer != "-1"
    IntOp $0 ${SF_SELECTED} | ${SF_RO}
    SectionSetFlags ${SecTBulgarian} $0
@@ -1427,6 +1425,8 @@ FunctionEnd
 # this function is called at first after starting the uninstaller
 Function un.onInit
 
+  SetRegView ${APP_VERSION_ACHITECHTURE}
+
   !insertmacro MULTIUSER_UNINIT
 
   # Check that LyX is not currently running