]> git.lyx.org Git - features.git/blobdiff - development/Win32/packaging/installer/include/detection.nsh
Consider inset strings in simple find/replaceAll (#12049)
[features.git] / development / Win32 / packaging / installer / include / detection.nsh
index 0d02308b835cc7f50faf92dc55abf919737c662c..01c44ff616f572808c784a57ced4f372061c1933 100644 (file)
@@ -1,4 +1,4 @@
-/*
+/*
 
 detection.nsh
 
@@ -27,6 +27,7 @@ Detection of external component locations
 Function SearchExternal
   Call LaTeXActions # function from LaTeX.nsh
   Call MissingPrograms
+  SetRegView ${APP_VERSION_ACHITECHTURE}
   Call FindDictionaries # function from dictionaries.nsh
 FunctionEnd
 
@@ -144,6 +145,9 @@ Function MissingPrograms
    StrCpy $ImageEditor "Photoshop"
   ${endif}
   # check for Krita
+  ${if} ${RunningX64}
+   SetRegView 64
+  ${endif}
   ReadRegStr $0 HKLM "SOFTWARE\Classes\Krita.Document\shell\open\command" ""
   ${if} $0 != ""
    StrCpy $0 "$0" -16 # delete '\krita.exe" "%1"'
@@ -155,19 +159,21 @@ Function MissingPrograms
    ${endif}
    StrCpy $ImageEditor "Krita"
   ${endif}
+  ${if} ${RunningX64}
+   SetRegView 32
+  ${endif}
 
   # test if and where the BibTeX-editor JabRef is installed
-  ReadRegStr $PathBibTeXEditor HKCU "Software\JabRef" "Path"
-  ${if} $PathBibTeXEditor == ""
-   ReadRegStr $PathBibTeXEditor HKLM "Software\JabRef" "Path"
+  ${if} ${RunningX64}
+   SetRegView 64
   ${endif}
-  # since JabRef 3.x the pathes are different
-  # there is currently a bug in the Jabref installer that prevents to install it without admin permissions
-  # therefore only check the admin installation
+  ReadRegStr $PathBibTeXEditor HKLM "SOFTWARE\JabRef" "Path"
+  # if not installed as admin, check for user
   ${if} $PathBibTeXEditor == ""
-   ReadRegStr $PathBibTeXEditor HKLM "SOFTWARE\Classes\JabRef\shell\open\command" ""
-   StrCpy $PathBibTeXEditor $PathBibTeXEditor -17 # remove '\JabRef.exe" "%1"'
-   StrCpy $PathBibTeXEditor $PathBibTeXEditor "" 1 # remove the leading quote
+   ReadRegStr $PathBibTeXEditor HKCU "Software\JabRef" "Path"
+  ${endif}
+  ${if} ${RunningX64}
+   SetRegView 32
   ${endif}
 
   ${ifnot} ${FileExists} "$PathBibTeXEditor\${BIN_BIBTEXEDITOR}"