]> git.lyx.org Git - lyx.git/commitdiff
installer: add the Metafile2EPS converter as it is now working on all Windows platforms
authorUwe Stöhr <uwestoehr@web.de>
Wed, 12 Nov 2008 02:32:02 +0000 (02:32 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Wed, 12 Nov 2008 02:32:02 +0000 (02:32 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27392 a592a061-630c-0410-9148-cb99ea01b6c8

development/Win32/packaging/AltInstaller/ConfigLyX.nsh
development/Win32/packaging/AltInstaller/InstallActions-complete-small.nsh
development/Win32/packaging/AltInstaller/InstallThirdPartyProgs.nsh
development/Win32/packaging/AltInstaller/LyXInstaller-complete.nsi
development/Win32/packaging/AltInstaller/LyXInstaller-small.nsi
development/Win32/packaging/AltInstaller/MissingPrograms.nsh
development/Win32/packaging/AltInstaller/Settings.nsh
development/Win32/packaging/AltInstaller/Uninstall.nsh
development/Win32/packaging/AltInstaller/Updated.nsh

index 25a10e9aa8d37063215fd0b127daecbe2317518f..8826da97f2e4306766058785552eb174baa707f8 100644 (file)
@@ -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
index b8540f4024aa8a790a75d4e794ac3fcc01e0105f..120c8ace7db5570cf86dbbacb8386fd6a2b1f4ac 100644 (file)
@@ -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
index 066d29c13a7a65f9a580616d889ad4c476708bc8..05204a7a993562643e0dfe8b9bccaf35327318be 100644 (file)
@@ -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
index 9f3f5456bb011ef42e2b2bb36c592a6bfe0d37a0..de9c2079348feb45a08d18aacf06dd438e5f390c 100644 (file)
@@ -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
index 77f95c3d4fbbad88129b0f1598261c7616c0f8a7..4a1b84834c361fcb1361329c32367f117c4a7ff6 100644 (file)
@@ -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
index ccf5001b775bd59672bdfcd27b6d9b6454fddfea..d8999a1233346e869bcd602344fcb84fc64d415b 100644 (file)
@@ -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
 
index 94f0719e0738e8a3c6363ba11cd7061887951cce..a9686b8482050b2d5e4ac14725ee2bbfb0de92dd 100644 (file)
@@ -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"
index 2de001efd9e860e9baabd2c8f46314712877d09a..380c8c76bb34ea858ec79ff2c1b66da50115f46d 100644 (file)
@@ -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
index d2c0828bff50f020e6d79b9e7f3705e9e16ec093..456b014fb9507aff4a5e39820d1049e99c14ad35 100644 (file)
@@ -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