From: Uwe Stöhr Date: Wed, 12 Nov 2008 02:32:02 +0000 (+0000) Subject: installer: add the Metafile2EPS converter as it is now working on all Windows platforms X-Git-Tag: 1.6.10~2648 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c1309f2fc2ef96fa9f639fe788798dafa2dbe53c;p=lyx.git installer: add the Metafile2EPS converter as it is now working on all Windows platforms git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27392 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/development/Win32/packaging/AltInstaller/ConfigLyX.nsh b/development/Win32/packaging/AltInstaller/ConfigLyX.nsh index 25a10e9aa8..8826da97f2 100644 --- a/development/Win32/packaging/AltInstaller/ConfigLyX.nsh +++ b/development/Win32/packaging/AltInstaller/ConfigLyX.nsh @@ -27,6 +27,9 @@ Function ConfigureLyX ${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 diff --git a/development/Win32/packaging/AltInstaller/InstallActions-complete-small.nsh b/development/Win32/packaging/AltInstaller/InstallActions-complete-small.nsh index b8540f4024..120c8ace7d 100644 --- a/development/Win32/packaging/AltInstaller/InstallActions-complete-small.nsh +++ b/development/Win32/packaging/AltInstaller/InstallActions-complete-small.nsh @@ -33,6 +33,9 @@ # 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 diff --git a/development/Win32/packaging/AltInstaller/InstallThirdPartyProgs.nsh b/development/Win32/packaging/AltInstaller/InstallThirdPartyProgs.nsh index 066d29c13a..05204a7a99 100644 --- a/development/Win32/packaging/AltInstaller/InstallThirdPartyProgs.nsh +++ b/development/Win32/packaging/AltInstaller/InstallThirdPartyProgs.nsh @@ -47,6 +47,7 @@ Function ImageMagick 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} @@ -72,6 +73,45 @@ FunctionEnd # ------------------------------------------- +!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 diff --git a/development/Win32/packaging/AltInstaller/LyXInstaller-complete.nsi b/development/Win32/packaging/AltInstaller/LyXInstaller-complete.nsi index 9f3f5456bb..de9c207934 100644 --- a/development/Win32/packaging/AltInstaller/LyXInstaller-complete.nsi +++ b/development/Win32/packaging/AltInstaller/LyXInstaller-complete.nsi @@ -35,27 +35,31 @@ CRCCheck force #-------------------------------- # 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" @@ -66,6 +70,7 @@ Var AppFiles !include "FileFunc.nsh" !include "StrFunc.nsh" !include "TextFunc.nsh" +!include "WinVer.nsh" # Set of various macros and functions !include "LyXUtils.nsh" @@ -221,6 +226,9 @@ Function .onInit 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 diff --git a/development/Win32/packaging/AltInstaller/LyXInstaller-small.nsi b/development/Win32/packaging/AltInstaller/LyXInstaller-small.nsi index 77f95c3d4f..4a1b84834c 100644 --- a/development/Win32/packaging/AltInstaller/LyXInstaller-small.nsi +++ b/development/Win32/packaging/AltInstaller/LyXInstaller-small.nsi @@ -35,25 +35,30 @@ CRCCheck force #-------------------------------- # 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" @@ -64,6 +69,7 @@ Var AppFiles !include "FileFunc.nsh" !include "StrFunc.nsh" !include "TextFunc.nsh" +!include "WinVer.nsh" # Set of various macros and functions !include "LyXUtils.nsh" @@ -215,6 +221,9 @@ Function .onInit 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 diff --git a/development/Win32/packaging/AltInstaller/MissingPrograms.nsh b/development/Win32/packaging/AltInstaller/MissingPrograms.nsh index ccf5001b77..d8999a1233 100644 --- a/development/Win32/packaging/AltInstaller/MissingPrograms.nsh +++ b/development/Win32/packaging/AltInstaller/MissingPrograms.nsh @@ -149,6 +149,9 @@ Function MissingPrograms # 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 diff --git a/development/Win32/packaging/AltInstaller/Settings.nsh b/development/Win32/packaging/AltInstaller/Settings.nsh index 94f0719e07..a9686b8482 100644 --- a/development/Win32/packaging/AltInstaller/Settings.nsh +++ b/development/Win32/packaging/AltInstaller/Settings.nsh @@ -71,6 +71,7 @@ BrandingText "LyXWinInstaller v4.${INSTALLER_SUBVERSION} - ${INSTALLER_VERSION}" !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" diff --git a/development/Win32/packaging/AltInstaller/Uninstall.nsh b/development/Win32/packaging/AltInstaller/Uninstall.nsh index 2de001efd9..380c8c76bb 100644 --- a/development/Win32/packaging/AltInstaller/Uninstall.nsh +++ b/development/Win32/packaging/AltInstaller/Uninstall.nsh @@ -34,6 +34,9 @@ Function un.onInit 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 @@ -157,6 +160,16 @@ Section "un.LyX" un.SecUnProgramFiles 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 diff --git a/development/Win32/packaging/AltInstaller/Updated.nsh b/development/Win32/packaging/AltInstaller/Updated.nsh index d2c0828bff..456b014fb9 100644 --- a/development/Win32/packaging/AltInstaller/Updated.nsh +++ b/development/Win32/packaging/AltInstaller/Updated.nsh @@ -6,8 +6,14 @@ Function UpdateModifiedFiles 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