${if} $SVGPath != ""
StrCpy $PathPrefix "$PathPrefix;$SVGPath"
${endif}
+ ${if} $WMFPath != ""
+ StrCpy $PathPrefix "$PathPrefix;$WMFPath"
+ ${endif}
# Create a batch file to start LyX with the environment variables set
ClearErrors
# install Aiksaurus if not already installed
Call Aiksaurus # function from InstallThirdPartyProgs.nsh
+
+ # install Metafile2eps if not already installed
+ Call Metafile2eps # function from InstallThirdPartyProgs.nsh
!if ${INSTALLER_VERSION} == "Complete"
# install GSview if not already installed and the user selected it
RMDir /r ${ImageMagickDir}
# delete the "etc" folder when also the Ghostscript folder was deleted because it is then empty
${if} $DelGSDir == "Yes"
+ ${andif} $DelWMFDir == "Yes"
RMDir /r "$INSTDIR\etc"
${endif}
${endif}
# -------------------------------------------
+!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
+ WriteRegStr HKLM "Software\InkNote Selector" "" ${Metafile2epsDir}
+ # register Metafile2eps
+ Var /GLOBAL RegLocation
+ StrCpy $RegLocation "Software\Microsoft\Windows\CurrentVersion\Uninstall\Metafile to EPS Converter"
+ 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}"
+ ${else}
+ # delete unnecessary files
+ RMDir /r "${Metafile2epsDir}"
+ StrCpy $DelWMFDir "Yes" # used later in function ImageMagick
+ ${endif}
+
+FunctionEnd
+
+# -------------------------------------------
+
!if ${INSTALLER_VERSION} == "Complete"
Function PostScript
#--------------------------------
# variables only used in this installer version
-Var DelPythonFiles
-Var GhostscriptPath
+Var Acrobat
Var AiksaurusPath
+Var AppFiles
Var AspellPath
-Var Acrobat
-Var PSVPath
+Var BibTeXEditorPath
Var DelGSDir
+Var DelPythonFiles
+Var DelWMFDir
Var EditorPath
+Var GhostscriptPath
Var ImageEditorPath
-Var BibTeXEditorPath
+Var InstallGSview
+Var InstallJabRef
Var LangEncoding
Var LangSysEncoding
-Var MissedProg
Var LaTeXName
Var MiKTeXVersion
Var MiKTeXUser
Var MiKTeXPath
-Var InstallGSview
-Var InstallJabRef
+Var MissedProg
+Var PrinterConf
+Var PSVPath
Var SVGPath
-Var AppFiles
+Var WMFPath
+
# Variables used by all installer versions
!include "Variables.nsh"
!include "FileFunc.nsh"
!include "StrFunc.nsh"
!include "TextFunc.nsh"
+!include "WinVer.nsh"
# Set of various macros and functions
!include "LyXUtils.nsh"
MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
Abort
${endif}
+
+ # printer settings, needed to install the Metafile2eps printer
+ !insertmacro PrinterInit
# default settings
# these can be reset to "all" in section SecAllUsers
#--------------------------------
# variables only used in this installer version
-Var DelPythonFiles
+Var AppFiles
+
Var GhostscriptPath
Var AiksaurusPath
Var AspellPath
Var Acrobat
-Var PSVPath
+Var BibTeXEditorPath
Var DelGSDir
+Var DelPythonFiles
+Var DelWMFDir
Var EditorPath
Var ImageEditorPath
-Var BibTeXEditorPath
Var LangEncoding
Var LangSysEncoding
-Var MissedProg
Var LaTeXName
Var MiKTeXVersion
Var MiKTeXUser
+Var MissedProg
+Var PrinterConf
+Var PSVPath
Var State
Var SVGPath
-Var AppFiles
+Var WMFPath
+
# Variables used by all installer versions
!include "Variables.nsh"
!include "FileFunc.nsh"
!include "StrFunc.nsh"
!include "TextFunc.nsh"
+!include "WinVer.nsh"
# Set of various macros and functions
!include "LyXUtils.nsh"
MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
Abort
${endif}
+
+ # printer settings, needed to install the Metafile2eps printer
+ !insertmacro PrinterInit
# default settings
# these can be reset to "all" in section SecAllUsers
# test if Inkscape is installed
ReadRegStr $SVGPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Inkscape" "InstallLocation"
+
+ # test if metafile2eps is installed
+ ReadRegStr $WMFPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Metafile to EPS Converter" "InstallLocation"
FunctionEnd
!define ImageMagickDir "$INSTDIR\etc\ImageMagick"
!define GhostscriptDir "$INSTDIR\etc\Ghostscript"
!define GhostscriptVersion "8.63"
+!define Metafile2epsDir "$INSTDIR\etc\Metafile2eps"
!define AiksaurusDir "$APPDATA\Aiksaurus"
!define AiksaurusInstall "external\Aiksaurus"
!define AspellDir "$APPDATA\Aspell"
MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
${endif}
${endif}
+
+ # printer settings, needed to uninstall the Metafile2eps printer
+ !insertmacro PrinterInit
# Macro to investigate name of LyX's preferences folders to be able remove them
!insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
DeleteRegValue SHCTX "SOFTWARE\Classes\Applications" "AutoRun"
DeleteRegKey SHCTX "SOFTWARE\ImageMagick"
${endif}
+
+ # Metafile2eps
+ ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Metafile to EPS Converter" "OnlyWithLyX" # special entry to test if it was installed with LyX
+ ${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
+ # Delete printer
+ ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
+ # unregister Metafile2eps
+ DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Metafile to EPS Converter"
+ DeleteRegKey HKLM "Software\InkNote Selector"
+ ${endif}
# Ghostscript and GSview
ReadRegStr $0 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" # special entry to test if it was installed with LyX
File "${PRODUCT_SOURCEDIR}\bin\tex2lyx.exe" # always here
SetOutPath "$INSTDIR\Resources" # always here
File /r "${PRODUCT_SOURCEDIR}\Resources\locale" # always here
+ File "${PRODUCT_SOURCEDIR}\Resources\configure.py"
+ SetOutPath "$INSTDIR\Resources\layouts"
+ File "${PRODUCT_SOURCEDIR}\Resources\layouts\amsbook.layout"
SetOutPath "$INSTDIR\Resources\lyx2lyx" # always here
File "${PRODUCT_SOURCEDIR}\Resources\lyx2lyx\lyx2lyx_version.py" # always here
+ File "${PRODUCT_SOURCEDIR}\Resources\lyx2lyx\lyx_1_6.py"
+ SetOutPath "$INSTDIR\Resources\man\man1"
+ File "${PRODUCT_SOURCEDIR}\Resources\man\man1\lyx.1"
FunctionEnd