installer: add up to date check for inkscape

also fine-tune the conversion of wmf/emf images
This commit is contained in:
Uwe Stöhr 2015-12-02 00:47:05 +01:00
parent 3fc47f2a5c
commit fe450c850c
2 changed files with 19 additions and 8 deletions

View File

@ -162,7 +162,15 @@ 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" ""

View 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\