From 56e208bbaf2c981a108c4f24fb9a5b66308f84df Mon Sep 17 00:00:00 2001 From: Joost Verburg Date: Sat, 5 Apr 2008 19:12:37 +0000 Subject: [PATCH] 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 --- .../installer/include/declarations.nsh | 2 ++ .../packaging/installer/include/filelist.nsh | 14 +++++++++++ .../packaging/installer/include/init.nsh | 12 +++++++++ .../Win32/packaging/installer/settings.nsh | 2 ++ .../packaging/installer/setup/configure.nsh | 25 +++++++++++++++++++ .../packaging/installer/setup/install.nsh | 8 ++++++ .../packaging/installer/setup/uninstall.nsh | 19 +++++++++++++- 7 files changed, 81 insertions(+), 1 deletion(-) diff --git a/development/Win32/packaging/installer/include/declarations.nsh b/development/Win32/packaging/installer/include/declarations.nsh index 2ffe6c3a7a..a7bd3b6b9b 100644 --- a/development/Win32/packaging/installer/include/declarations.nsh +++ b/development/Win32/packaging/installer/include/declarations.nsh @@ -63,6 +63,8 @@ Var SizeGhostscript Var LangName Var LangISOCode + +Var PrinterConf #-------------------------------- # Include standard functions diff --git a/development/Win32/packaging/installer/include/filelist.nsh b/development/Win32/packaging/installer/include/filelist.nsh index 67483a4f1f..07184ff640 100644 --- a/development/Win32/packaging/installer/include/filelist.nsh +++ b/development/Win32/packaging/installer/include/filelist.nsh @@ -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 diff --git a/development/Win32/packaging/installer/include/init.nsh b/development/Win32/packaging/installer/include/init.nsh index 19e533e066..6e4685a834 100644 --- a/development/Win32/packaging/installer/include/init.nsh +++ b/development/Win32/packaging/installer/include/init.nsh @@ -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 diff --git a/development/Win32/packaging/installer/settings.nsh b/development/Win32/packaging/installer/settings.nsh index c5afcc37f6..a9fa114986 100644 --- a/development/Win32/packaging/installer/settings.nsh +++ b/development/Win32/packaging/installer/settings.nsh @@ -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" diff --git a/development/Win32/packaging/installer/setup/configure.nsh b/development/Win32/packaging/installer/setup/configure.nsh index 559dac228e..3ca1dc99b2 100644 --- a/development/Win32/packaging/installer/setup/configure.nsh +++ b/development/Win32/packaging/installer/setup/configure.nsh @@ -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 diff --git a/development/Win32/packaging/installer/setup/install.nsh b/development/Win32/packaging/installer/setup/install.nsh index 724bd78163..e540dbd41d 100644 --- a/development/Win32/packaging/installer/setup/install.nsh +++ b/development/Win32/packaging/installer/setup/install.nsh @@ -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}" diff --git a/development/Win32/packaging/installer/setup/uninstall.nsh b/development/Win32/packaging/installer/setup/uninstall.nsh index 6ba0246c99..1e903de54a 100644 --- a/development/Win32/packaging/installer/setup/uninstall.nsh +++ b/development/Win32/packaging/installer/setup/uninstall.nsh @@ -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