2007-05-15 22:43:05 +00:00
# this file contains the installation actions for the third-party programs
2007-04-24 22:08:27 +00:00
Function Ghostscript
2007-05-01 17:55:54 +00:00
# if GhostScript is not installed
2007-02-08 21:09:30 +00:00
${if} $GhostscriptPath == " "
2007-05-01 17:55:54 +00:00
# register Ghostscript
2007-02-08 21:09:30 +00:00
WriteRegStr HKLM " SOFTWARE\GPL Ghostscript\${GhostscriptVersion} " " GS_DLL " " ${GhostscriptDir}\bin\gsdll32.dll "
2008-09-25 21:15:38 +00:00
WriteRegStr HKLM " SOFTWARE\GPL Ghostscript\${GhostscriptVersion} " " GS_LIB " " ${GhostscriptDir}\lib "
2007-02-08 21:09:30 +00:00
2007-05-01 17:55:54 +00:00
WriteRegStr HKLM " SOFTWARE\GPL Ghostscript " " OnlyWithLyX " " Yes${PRODUCT_VERSION_SHORT} " # special entry to tell the uninstaller that it was installed with LyX
2007-02-08 21:09:30 +00:00
StrCpy $GhostscriptPath " ${GhostscriptDir}\bin "
${else}
2007-05-01 17:55:54 +00:00
# delete unnecessary files
2007-05-08 00:24:52 +00:00
RMDir /r ${GhostscriptDir}
2007-06-04 01:05:38 +00:00
StrCpy $DelGSDir " Yes " # used later in function ImageMagick
2007-02-08 21:09:30 +00:00
${endif}
2007-04-24 22:08:27 +00:00
FunctionEnd
2007-05-01 17:55:54 +00:00
# -------------------------------------------
2007-04-24 22:08:27 +00:00
Function ImageMagick
2007-05-01 17:55:54 +00:00
# if ImageMagick is not installed
2007-02-08 21:09:30 +00:00
${if} $ImageMagickPath == " "
2007-05-01 17:55:54 +00:00
# register ImageMagick
2007-02-08 21:09:30 +00:00
WriteRegStr HKLM " SOFTWARE\Classes\Applications " " AutoRun " " ${ImageMagickDir}\convert.exe $$ "
WriteRegStr HKLM " SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16 " " BinPath " " ${ImageMagickDir} "
WriteRegStr HKLM " SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16 " " CoderModulesPath " " ${ImageMagickDir}\modules\coders "
WriteRegStr HKLM " SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16 " " ConfigurePath " " ${ImageMagickDir}\config "
WriteRegStr HKLM " SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16 " " FilterModulesPath " " ${ImageMagickDir}\modules\filters "
WriteRegStr HKLM " SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16 " " LibPath " " ${ImageMagickDir} "
WriteRegStr HKLM " SOFTWARE\ImageMagick\Current " " BinPath " " ${ImageMagickDir} "
WriteRegStr HKLM " SOFTWARE\ImageMagick\Current " " CoderModulesPath " " ${ImageMagickDir}\modules\coders "
WriteRegStr HKLM " SOFTWARE\ImageMagick\Current " " ConfigurePath " " ${ImageMagickDir}\config "
WriteRegStr HKLM " SOFTWARE\ImageMagick\Current " " FilterModulesPath " " ${ImageMagickDir}\modules\filters "
WriteRegStr HKLM " SOFTWARE\ImageMagick\Current " " LibPath " " ${ImageMagickDir} "
WriteRegDWORD HKLM " SOFTWARE\ImageMagick\Current " " QuantumDepth " 0x00000010
WriteRegStr HKLM " SOFTWARE\ImageMagick\Current " " Version " " ${ImageMagickVersion} "
2007-05-01 17:55:54 +00:00
WriteRegStr HKLM " Software\ImageMagick " " OnlyWithLyX " " Yes${PRODUCT_VERSION_SHORT} " # special entry to tell the uninstaller that it was installed with LyX
2007-02-08 21:09:30 +00:00
StrCpy $ImageMagickPath ${ImageMagickDir}
${else}
2007-05-01 17:55:54 +00:00
# delete unnecessary files
2007-02-08 21:09:30 +00:00
RMDir /r ${ImageMagickDir}
2007-06-04 01:05:38 +00:00
# delete the "etc" folder when also the Ghostscript folder was deleted because it is then empty
${if} $DelGSDir == " Yes "
2008-11-12 02:32:02 +00:00
${andif} $DelWMFDir == " Yes "
2007-06-04 01:05:38 +00:00
RMDir /r " $INSTDIR \etc "
${endif}
2007-02-08 21:09:30 +00:00
${endif}
2007-04-24 22:08:27 +00:00
FunctionEnd
2007-05-01 17:55:54 +00:00
# -------------------------------------------
2007-04-24 22:08:27 +00:00
2009-11-10 03:35:49 +00:00
Function eLyXer
# install eLyXer as Python module
${if} $PythonPath != " "
# a Python module cannot simply started with
# ExecWait '$PythonPath\python.exe "$INSTDIR\bin\setup.py" install'
# therefore run a script
StrCpy $1 $INSTDIR 2 # get drive letter
FileOpen $R1 " $INSTDIR \bin\eLyXer.bat " w
FileWrite $R1 ' $1 $ \ r$ \ n\
cd " $INSTDIR \bin " $ \ r$ \ n\
" $PythonPath \python.exe " setup.py install'
FileClose $R1
ExecWait '"$INSTDIR\bin\eLyXer.bat"'
Delete " $INSTDIR \bin\eLyXer.bat "
${else}
ExecWait '"$INSTDIR\bin\python.exe" "$INSTDIR\bin\setup.py" install'
${endif}
FunctionEnd
# -------------------------------------------
2007-04-24 22:08:27 +00:00
Function Aiksaurus
2007-05-01 17:55:54 +00:00
# if Aiksaurus is not installed
2007-02-08 21:09:30 +00:00
${if} $AiksaurusPath == " "
2007-05-01 17:55:54 +00:00
# extract Aiksaurus' program files
2007-02-08 21:09:30 +00:00
SetOutPath " $INSTDIR \external "
File /r " ${PRODUCT_SOURCEDIR}\${AiksaurusInstall} "
2007-05-01 17:55:54 +00:00
# copy the files and register Aiksaurus
2007-02-08 21:09:30 +00:00
CopyFiles " $INSTDIR \${AiksaurusInstall} " " $APPDATA "
2007-05-01 17:55:54 +00:00
# WriteRegStr HKLM "Software\Aiksaurus" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}" # special entry to tell the uninstaller that it was installed with LyX
# WriteRegStr HKLM "Software\Aiksaurus" "Data Path" "${AiksaurusDir}"
2007-02-08 21:09:30 +00:00
${endif}
2007-04-24 22:08:27 +00:00
FunctionEnd
2007-05-01 17:55:54 +00:00
# -------------------------------------------
2007-04-24 22:08:27 +00:00
2008-11-12 02:32:02 +00:00
!macro PrinterInit
${if} ${AtLeastWinVista}
StrCpy $PrinterConf " printui.exe "
${else}
StrCpy $PrinterConf " rundll32.exe printui.dll,PrintUIEntry "
${endif}
!macroend
Function Metafile2eps
# if Metafile2eps is not installed
${if} $WMFPath == " "
# delete printer
ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
# install printer and driver
ExecWait '$PrinterConf /if /f "$WINDIR\inf\ntprint.inf" /b "Metafile to EPS Converter" /r "FILE:" /m "MS Publisher Imagesetter"'
# restore DEVMODE with proper settings
ExecWait '$PrinterConf /q /Sr /n "Metafile to EPS Converter" /a "$INSTDIR\metafile2eps.dat" g'
# register printer
2009-04-19 21:34:44 +00:00
WriteRegStr HKLM " SOFTWARE\InkNote Selector " " " ${Metafile2epsDir}
2008-11-12 02:32:02 +00:00
# register Metafile2eps
Var /GLOBAL RegLocation
2009-04-19 21:34:44 +00:00
StrCpy $RegLocation " SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Metafile to EPS Converter "
2008-11-12 02:32:02 +00:00
WriteRegStr HKLM " $RegLocation " " InstallLocation " " ${Metafile2epsDir} "
WriteRegStr HKLM " $RegLocation " " DisplayName " " Metafile to EPS Converter "
WriteRegStr HKLM " $RegLocation " " OnlyWithLyX " " Yes${PRODUCT_VERSION_SHORT} " # special entry to tell the uninstaller that it was installed with LyX
StrCpy $WMFPath " ${Metafile2epsDir} "
2009-04-19 21:34:44 +00:00
# delete temporary file
Delete " $INSTDIR \metafile2eps.dat "
2008-11-12 02:32:02 +00:00
${else}
# delete unnecessary files
RMDir /r " ${Metafile2epsDir} "
StrCpy $DelWMFDir " Yes " # used later in function ImageMagick
${endif}
FunctionEnd
# -------------------------------------------
2007-05-15 22:43:05 +00:00
!if ${INSTALLER_VERSION} == " Complete "
2007-04-24 22:08:27 +00:00
2007-05-15 22:43:05 +00:00
Function PostScript
# if no PostScript viewer is installed
2007-02-08 21:09:30 +00:00
${if} $PSVPath == " "
${if} $InstallGSview == " true "
2007-05-01 17:55:54 +00:00
# launch installer
2007-02-08 21:09:30 +00:00
MessageBox MB_OK | MB_ICONINFORMATION " $(GSviewInfo) "
ExecWait " $INSTDIR \${GSviewInstall} "
2007-05-01 17:55:54 +00:00
# test if GSview is installed
2007-02-08 21:09:30 +00:00
StrCpy $PSVPath " "
ReadRegStr $PSVPath HKLM " Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe " " Path "
${if} $PSVPath == " "
MessageBox MB_OK | MB_ICONEXCLAMATION " $(GSviewError) "
${endif}
${endif}
${endif}
2007-04-19 00:55:52 +00:00
2007-05-15 22:43:05 +00:00
FunctionEnd
!endif # endif ${INSTALLER_VERSION} == "Complete"
2007-04-24 22:08:27 +00:00
2007-05-01 17:55:54 +00:00
# -------------------------------------------
2007-04-24 22:08:27 +00:00
2007-05-15 22:43:05 +00:00
!if ${INSTALLER_VERSION} == " Complete "
2007-04-24 22:08:27 +00:00
2007-05-15 22:43:05 +00:00
Function BibTeX
# if no BibTeX editor is installed
2007-02-08 21:09:30 +00:00
${if} $BibTeXEditorPath == " "
${if} $InstallJabRef == " true "
2007-05-01 17:55:54 +00:00
# launch installer
2007-02-08 21:09:30 +00:00
MessageBox MB_OK | MB_ICONINFORMATION " $(JabRefInfo) "
ExecWait " $INSTDIR \${JabRefInstall} "
2007-05-01 17:55:54 +00:00
# test if JabRef is installed
2007-02-08 21:09:30 +00:00
StrCpy $BibTeXEditorPath " "
2007-08-25 19:56:18 +00:00
ReadRegStr $BibTeXEditorPath HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion} " " UninstallString "
2007-02-08 21:09:30 +00:00
${if} $BibTeXEditorPath == " "
MessageBox MB_OK | MB_ICONEXCLAMATION " $(JabRefError) "
${else}
2007-08-25 19:56:18 +00:00
WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion} " " OnlyWithLyX " " Yes${PRODUCT_VERSION_SHORT} " # special entry to tell the uninstaller that it was installed with LyX
2007-02-08 21:09:30 +00:00
${endif}
${endif}
${endif}
2007-05-15 22:43:05 +00:00
FunctionEnd
!endif # endif ${INSTALLER_VERSION} == "Complete"
2007-02-08 21:09:30 +00:00