]> 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 4276a07cb7e46d1825fe3e7332c03ea171c17b49..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
@@ -594,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
@@ -651,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 != ""
@@ -1412,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