install and configure application/printer for metafile (EMF/WMF) to EPS conversion

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24130 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Joost Verburg 2008-04-05 19:12:37 +00:00
parent 835d051ae3
commit 56e208bbaf
7 changed files with 81 additions and 1 deletions

View File

@ -63,6 +63,8 @@ Var SizeGhostscript
Var LangName
Var LangISOCode
Var PrinterConf
#--------------------------------
# Include standard functions

View File

@ -297,3 +297,17 @@ Lists of files to include in the installer
${FILE}Console.dll"
!macroend
!macro FileListMetaFile2EPS COMMAND DIRECTORY
${FILE}metafile2eps.exe"
!macroend
!macro FileListPSPrinter COMMAND DIRECTORY
${FILE}metafile2eps.inf"
${FILE}metafile2eps.ppd"
${FILE}metafile2eps.dat"
!macroend

View File

@ -9,6 +9,16 @@ Initialization function
#--------------------------------
# Installer initialization
!macro PRINTER_INIT
${If} ${AtLeastWinVista}
StrCpy $PrinterConf "printui.exe"
${Else}
StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
${EndIf}
!macroend
Function .onInit
${IfNot} ${IsNT}
@ -17,6 +27,7 @@ Function .onInit
Quit
${EndIf}
!insertmacro PRINTER_INIT
!insertmacro MULTIUSER_INIT
${unless} ${silent}
@ -34,6 +45,7 @@ FunctionEnd
Function un.onInit
!insertmacro PRINTER_INIT
!insertmacro MULTIUSER_UNINIT
FunctionEnd

View File

@ -52,6 +52,8 @@ SetCompressor /SOLID lzma
!define FILES_DVIPOST "${FILES_DEPS}\dvipost"
!define FILES_DVIPOST_PKG "${FILES_DVIPOST}"
!define FILES_PDFTOOLS "${FILES_DEPS}\pdftools"
!define FILES_METAFILE2EPS "${FILES_DEPS}\metafile2eps"
!define FILES_PSPRINTER "${FILES_DEPS}\metafile2eps\PSPrinter"
!define FILES_QT "${FILES_DEPS}\qt-4"
!define FILES_ASPELLDATA "${FILES_DEPS}\aspell"

View File

@ -138,6 +138,31 @@ Section -dvipost
SectionEnd
#--------------------------------
# Postscript printer for metafile to EPS converter
Section -PSPrinter
${If} $MultiUser.Privileges != "Admin"
${OrIf} $MultiUser.Privileges != "Power"
# Delete printer
ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
# Delete printer driver
ExecWait '$PrinterConf /q /dd /m "Metafile to EPS Converter"'
# Install printer and driver
ExecWait '$PrinterConf /q /if /f "$INSTDIR\PSPrinter\metafile2eps.inf" /r "FILE:" /m "Metafile to EPS Converter"'
# Restore DEVMODE with proper settings
ExecWait '$PrinterConf /q /Sr /n "Metafile to EPS Converter" /a "$INSTDIR\PSPrinter\metafile2eps.dat" g'
${EndIf}
SectionEnd
#--------------------------------
# Desktop shortcut

View File

@ -87,6 +87,14 @@ Section -ProgramFiles SecProgramFiles
!insertmacro FileListNSISPluginsStandard File "${NSISDIR}\Plugins\"
!insertmacro FileListNSISPlugins File "${FILES_NSISPLUGINS}\"
# Metafile to EPS Converter
SetOutPath "$INSTDIR\bin"
!insertmacro FileListMetaFile2EPS File "${FILES_METAFILE2EPS}\"
# Postscript printer for metafile to EPS converter
SetOutPath "$INSTDIR\PSPrinter"
!insertmacro FileListPSPrinter File "${FILES_PSPRINTER}\"
# Create uninstaller
WriteUninstaller "$INSTDIR\${SETUP_UNINSTALLER}"

View File

@ -46,7 +46,13 @@ Section "un.Program Files" un.SecProgramFiles
# Helper DLLs for NSIS-based tools
!insertmacro FileListNSISPluginsStandard Delete "$INSTDIR\bin\"
!insertmacro FileListNSISPlugins Delete "$INSTDIR\bin\"
!insertmacro FileListNSISPlugins Delete "$INSTDIR\bin\"
# Metafile to EPS Converter
!insertmacro FileListMetaFile2EPS Delete "$INSTDIR\bin\"
# Postscript printer for metafile to EPS converter
!insertmacro FileListPSPrinter Delete "$INSTDIR\PSPrinter\"
# Shortcuts
@ -78,6 +84,17 @@ Section "un.Program Files" un.SecProgramFiles
DeleteRegKey SHELL_CONTEXT "Software\Classes\${APP_EXT}"
${EndIf}
${If} $MultiUser.Privileges != "Admin"
${OrIf} $MultiUser.Privileges != "Power"
# Delete Postscript printer for metafile o EPS conversion
ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
# Also delete printer driver
ExecWait '$PrinterConf /q /dd /m "Metafile to EPS Converter"'
${EndIf}
SectionEnd
Section "un.User Preferences and Custom Files" un.SecUserFiles