M
Michael A. Covington
I have an .inf file that installs just fine when I right-click on it and
choose Install, but when I execute the command:
rundll32.exe setupapi,InstallHinfSection DefaultInstall 132
LatexWithoutCommandPrompt.inf
I get "Installation failed." What's wrong?
For the curious, the whole file is reproduced below. Note that a few lines
may have wrapped.
Thanks in advance for anyone who can point out my errors!
---------------------------------cut here--------------------------------;
"LaTeX Without Command Prompt" (LaWCP) Utility
;
; Michael A. Covington - www.ai.uga.edu/mc - 2004
;
; This script makes it possible to run LaTeX and TeXify
; by right-clicking on the files.
; TO INSTALL:
; First make any necessary changes in the [Strings] section.
; Then right-click on the .inf file and choose Install.
;
; To install from the command line or in a .bat file:
; rundll32.exe setupapi,InstallHinfSection DefaultInstall 132
LatexWithoutCommandPrompt.inf
;
; To uninstall, use Control Panel, Add/Remove Programs
; or use the same command but with "DefaultUninstall" instead of
"DefaultInstall".
[Version]
signature="$Windows NT$"
;; Definitions of strings used subsequently
[Strings]
EDITOR="c:\Program Files\pfe\pfe32.exe" ; editor with which to open TeX
files
BACKUP=".$$$" ; extension of editor backup
files
LATEX="c:\texmf\miktex\bin\latex.exe" ; locations of TeX programs...
TEXIFY="c:\texmf\miktex\bin\texify.exe"
DVIPS="c:\texmf\miktex\bin\dvips.exe"
NAME="LaTeX Without Command Prompt utility" ; name
to use for uninstall
UDHERE="Software\Microsoft\Windows\CurrentVersion\Uninstall\LaWCP" ; where
to keep the uninstall info
FILENAME="LatexWithoutCommandPrompt.inf" ; this
file
;; How to install and uninstall
[DefaultInstall]
CopyFiles = LaWCP.Files.Inf
AddReg = LaWCP.Reg
[DefaultUninstall]
DelFiles = LaWCP.Files.Inf
DelReg = LaWCP.Reg
;; How to copy the .inf file from its present location
;; to the windows INF folder (directory 17) so it will be available
;; at uninstall time
[DestinationDirs]
LaWCP.Files.Inf = 17
[LaWCP.Files.Inf]
%FILENAME%
;; Registry entries to be installed (and removed upon uninstallation).
;; Throughout, %11% is windows\system32, where cmd.exe resides.
[LaWCP.Reg]
;; Label editor backup files as such, and always show their extensions
HKCR,"%BACKUP%",,,"Editor Backup File"
HKCR,"%BACKUP%",AlwaysShowExt
;; Always show extensions of the following file types
HKCR,".aux",AlwaysShowExt
HKCR,".lof",AlwaysShowExt
HKCR,".log",AlwaysShowExt
HKCR,".lot",AlwaysShowExt
HKCR,".toc",AlwaysShowExt
HKCR,".ps", AlwaysShowExt
HKCR,psfile,AlwaysShowExt
HKCR,txtfile,AlwaysShowExt
;; Options for .tex and .ltx files
HKCR,".ltx",,,"LaTeX.Document"
HKCR,".ltx",AlwaysShowExt
HKCR,".tex",,,"LaTeX.Document"
HKCR,".tex",AlwaysShowExt
HKCR,LaTeX.Document\shell\open,,,"Open"
HKCR,LaTeX.Document\shell\open\command,,,"""%EDITOR%"" ""%1"""
HKCR,LaTeX.Document\shell\latex
HKCR,LaTeX.Document\shell\latex,,,"LaTeX"
HKCR,LaTeX.Document\shell\latex\command,,,"""%11%\cmd.exe"" /s /c ""color f0
&& ""%LATEX%"" ""%1"" && echo. && pause"""
HKCR,LaTeX.Document\shell\latextwice
HKCR,LaTeX.Document\shell\latextwice,,,"TeXify"
HKCR,LaTeX.Document\shell\latextwice\command,,,"""%11%\cmd.exe"" /s /c
""color f0 && ""%TEXIFY%"" ""%1"" && echo. && pause"""
;; Options for .dvi files
HKCR,".dvi",,,LaTeX.DVI
HKCR,".dvi",AlwaysShowExt
HKCR,LaTeX.DVI\shell\dvips
HKCR,LaTeX.DVI\shell\dvips,,,"DVIPS"
HKCR,LaTeX.DVI\shell\dvips\command,,,"""%11%\cmd.exe"" /s /c ""color 70 &&
""%DVIPS%"" ""%1"" && echo. && pause"""
;; Icons.
;; These are taken from Windows' stock set, so they are also used for other
purposes.
HKCR,LaTeX.Document\DefaultIcon,,,"""%11%\shell32.dll"",-151" ; page with
a gear on it
HKCR,LaTeX.DVI\DefaultIcon,,, """%11%\shell32.dll"",-153" ; window
with a gear in it
;; How to uninstall this package using Add/Remove Programs
HKLM,%UDHERE%,DisplayName,,"%NAME%"
HKLM,%UDHERE%,UninstallString,,"rundll32.exe setupapi,InstallHinfSection
DefaultUninstall 132 %17%\%FILENAME%"
;; END.
choose Install, but when I execute the command:
rundll32.exe setupapi,InstallHinfSection DefaultInstall 132
LatexWithoutCommandPrompt.inf
I get "Installation failed." What's wrong?
For the curious, the whole file is reproduced below. Note that a few lines
may have wrapped.
Thanks in advance for anyone who can point out my errors!
---------------------------------cut here--------------------------------;
"LaTeX Without Command Prompt" (LaWCP) Utility
;
; Michael A. Covington - www.ai.uga.edu/mc - 2004
;
; This script makes it possible to run LaTeX and TeXify
; by right-clicking on the files.
; TO INSTALL:
; First make any necessary changes in the [Strings] section.
; Then right-click on the .inf file and choose Install.
;
; To install from the command line or in a .bat file:
; rundll32.exe setupapi,InstallHinfSection DefaultInstall 132
LatexWithoutCommandPrompt.inf
;
; To uninstall, use Control Panel, Add/Remove Programs
; or use the same command but with "DefaultUninstall" instead of
"DefaultInstall".
[Version]
signature="$Windows NT$"
;; Definitions of strings used subsequently
[Strings]
EDITOR="c:\Program Files\pfe\pfe32.exe" ; editor with which to open TeX
files
BACKUP=".$$$" ; extension of editor backup
files
LATEX="c:\texmf\miktex\bin\latex.exe" ; locations of TeX programs...
TEXIFY="c:\texmf\miktex\bin\texify.exe"
DVIPS="c:\texmf\miktex\bin\dvips.exe"
NAME="LaTeX Without Command Prompt utility" ; name
to use for uninstall
UDHERE="Software\Microsoft\Windows\CurrentVersion\Uninstall\LaWCP" ; where
to keep the uninstall info
FILENAME="LatexWithoutCommandPrompt.inf" ; this
file
;; How to install and uninstall
[DefaultInstall]
CopyFiles = LaWCP.Files.Inf
AddReg = LaWCP.Reg
[DefaultUninstall]
DelFiles = LaWCP.Files.Inf
DelReg = LaWCP.Reg
;; How to copy the .inf file from its present location
;; to the windows INF folder (directory 17) so it will be available
;; at uninstall time
[DestinationDirs]
LaWCP.Files.Inf = 17
[LaWCP.Files.Inf]
%FILENAME%
;; Registry entries to be installed (and removed upon uninstallation).
;; Throughout, %11% is windows\system32, where cmd.exe resides.
[LaWCP.Reg]
;; Label editor backup files as such, and always show their extensions
HKCR,"%BACKUP%",,,"Editor Backup File"
HKCR,"%BACKUP%",AlwaysShowExt
;; Always show extensions of the following file types
HKCR,".aux",AlwaysShowExt
HKCR,".lof",AlwaysShowExt
HKCR,".log",AlwaysShowExt
HKCR,".lot",AlwaysShowExt
HKCR,".toc",AlwaysShowExt
HKCR,".ps", AlwaysShowExt
HKCR,psfile,AlwaysShowExt
HKCR,txtfile,AlwaysShowExt
;; Options for .tex and .ltx files
HKCR,".ltx",,,"LaTeX.Document"
HKCR,".ltx",AlwaysShowExt
HKCR,".tex",,,"LaTeX.Document"
HKCR,".tex",AlwaysShowExt
HKCR,LaTeX.Document\shell\open,,,"Open"
HKCR,LaTeX.Document\shell\open\command,,,"""%EDITOR%"" ""%1"""
HKCR,LaTeX.Document\shell\latex
HKCR,LaTeX.Document\shell\latex,,,"LaTeX"
HKCR,LaTeX.Document\shell\latex\command,,,"""%11%\cmd.exe"" /s /c ""color f0
&& ""%LATEX%"" ""%1"" && echo. && pause"""
HKCR,LaTeX.Document\shell\latextwice
HKCR,LaTeX.Document\shell\latextwice,,,"TeXify"
HKCR,LaTeX.Document\shell\latextwice\command,,,"""%11%\cmd.exe"" /s /c
""color f0 && ""%TEXIFY%"" ""%1"" && echo. && pause"""
;; Options for .dvi files
HKCR,".dvi",,,LaTeX.DVI
HKCR,".dvi",AlwaysShowExt
HKCR,LaTeX.DVI\shell\dvips
HKCR,LaTeX.DVI\shell\dvips,,,"DVIPS"
HKCR,LaTeX.DVI\shell\dvips\command,,,"""%11%\cmd.exe"" /s /c ""color 70 &&
""%DVIPS%"" ""%1"" && echo. && pause"""
;; Icons.
;; These are taken from Windows' stock set, so they are also used for other
purposes.
HKCR,LaTeX.Document\DefaultIcon,,,"""%11%\shell32.dll"",-151" ; page with
a gear on it
HKCR,LaTeX.DVI\DefaultIcon,,, """%11%\shell32.dll"",-153" ; window
with a gear in it
;; How to uninstall this package using Add/Remove Programs
HKLM,%UDHERE%,DisplayName,,"%NAME%"
HKLM,%UDHERE%,UninstallString,,"rundll32.exe setupapi,InstallHinfSection
DefaultUninstall 132 %17%\%FILENAME%"
;; END.