]> git.lyx.org Git - features.git/commitdiff
installer: add up to date check for inkscape
authorUwe Stöhr <uwestoehr@lyx.org>
Tue, 1 Dec 2015 23:47:05 +0000 (00:47 +0100)
committerUwe Stöhr <uwestoehr@lyx.org>
Tue, 1 Dec 2015 23:47:05 +0000 (00:47 +0100)
 also fine-tune the conversion of wmf/emf images

development/Win32/packaging/installer/include/detection.nsh
development/Win32/packaging/installer/setup/configure.nsh

index b0d09b3b5e806574725fa84a5e45fd3106a56ec0..b0d4be742fba299920941d403e16420490a23216 100644 (file)
@@ -162,8 +162,16 @@ Function MissingPrograms
   ${endif}
   
   # test if Inkscape is installed
-  ReadRegStr $SVGPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Inkscape" "InstallLocation"
-  
+  ReadRegStr $SVGPath HKLM "SOFTWARE\Classes\inkscape.svg\DefaultIcon" ""
+  ${if} $SVGPath != ""
+   StrCpy $SVGPath $SVGPath "" 1 # remove the leading quote
+   StrCpy $SVGPath $SVGPath -14 # # delete '\inkscape.exe"'
+  ${endif}
+  ${if} $SVGPath == ""
+   # this was used before Inkscape 0.91:
+   ReadRegStr $SVGPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Inkscape" "InstallLocation"
+  ${endif}
+
   # test if Gnumeric is installed
   ReadRegStr $0 HKLM "Software\Classes\Applications\gnumeric.exe\shell\Open\command" ""
   ${if} $0 != ""
index 10410ef619eb6f23c33474e770dfd751cee12359..3b5a152368cc5367de08f48a4516c98434a9ddaf 100644 (file)
@@ -168,14 +168,17 @@ Section -Configure
                 \format "pdf2" "pdf" "PDF (pdflatex)" "F" "pdfview" "" "document,vector,menu=export" "application/pdf"$\r$\n\
                 \format "pdf" "pdf" "PDF (ps2pdf)" "P" "pdfview" "" "document,vector,menu=export" "application/pdf"$\r$\n'
 
-  # for the wmf image type we need to specify a resolution for the converter
-  # otherwise 1024 dpi are used and eps2pdf takes ages
-  # 300 dpi are a good compromise for speed and size
-  FileWrite $R1 '\converter "wmf" "eps" "convert -density 300 $$$$i $$$$o" ""$\r$\n'
+  # if Inkscape is not available Imagemagick will be used to convert WMF/EMF files
+  # We need to specify a resolution for the converter otherwise 1024 dpi are used and
+  # eps2pdf takes ages. 300 dpi are a good compromise for speed and size.
+  ${if} $SVGPath == ""
+   FileWrite $R1 '\converter "wmf" "eps" "convert -density 300 $$$$i $$$$o" ""$\r$\n\
+         \converter "emf" "eps" "convert -density 300 $$$$i $$$$o" ""$\r$\n'
+  ${endif}
   
   # if LilyPondPath was found
-  # we need to add these entris because python scripts can only be executed
-  # if the full path is given
+  # We need to add these entris because python scripts can only be executed
+  # if the full path is given.
   ${if} $LilyPondPath != ""
    FileWrite $R1 '\format "lilypond-book" "lytex" "LilyPond book (LaTeX)" "" "" "auto" "document,menu=export" ""$\r$\n\
                  \converter "lilypond-book" "pdflatex" "python \"$LilyPondPath\\lilypond-book.py\" --safe --pdf --latex-program=pdflatex --lily-output-dir=ly-pdf $$$$i" ""$\r$\n\