!define BIN_LATEX "tex.exe"
!define BIN_IMAGEMAGICK "convert.exe"
!define BIN_GHOSTSCRIPT "gswin32c.exe"
+!define BIN_BIBTEXEDITOR "JabRef.exe"
#--------------------------------
# Custom NSIS plug-ins
Function SearchExternal
Call SearchLaTeX
- Call SearchGhostscript
- Call SearchImageMagick
+ Call SearchBibTeXEditor
+ !ifndef BUNDLE_IMAGEMAGICK
+ Call SearchImageMagick
+ !endif
+ !ifndef BUNDLE_GHOSTSCRIPT
+ Call SearchGhostscript
+ !endif
FunctionEnd
#--------------------------------
#--------------------------------
# Ghostscript
+!ifndef BUNDLE_GHOSTSCRIPT
+
+!insertmacro GetParent
+!insertmacro VersionCompare
+
Var Counter
Var EnumReturn
Var CompareReturn
FunctionEnd
+!endif
+
#--------------------------------
# ImageMagick
+!ifndef BUNDLE_IMAGEMAGICK
+
Function SearchImageMagick
# Search where ImageMagick is installed
${EndIf}
FunctionEnd
+
+!endif
+
+#--------------------------------
+# JabRef
+
+Function SearchBibTeXEditor
+
+ # Search where JabRef is installed
+ ReadRegStr $PathBibTeXEditor HKCU "Software\JabRef" "Path"
+
+ ${IfNot} ${FileExists} "$PathBibTeXEditor\${BIN_BIBTEXEDITOR}"
+ ReadRegStr $PathBibTeXEditor HKLM "Software\JabRef" "Path"
+ ${EndIf}
+
+ ${IfNot} ${FileExists} "$PathBibTeXEditor\${BIN_BIBTEXEDITOR}"
+ StrCpy $PathBibTeXEditor ""
+ ${EndIf}
+
+FunctionEnd
#--------------------------------\r
# Include standard functions\r
\r
-!insertmacro GetParent\r
!insertmacro RefreshShellIcons\r
-!insertmacro VersionCompare\r
!insertmacro WordFind2X\r
${If} $PathImageMagick != ""
StrCpy $PathPrefix "$PathPrefix;$PathImageMagick"
${EndIf}
+ ${If} $PathBibTeXEditor != ""
+ StrCpy $PathPrefix "$PathPrefix;$PathBibTeXEditor"
+ ${EndIf}
FileWrite $DistFile '\path_prefix "$PathPrefix"$\r$\n'