Installer for windows 7/8 driver - windows

I have a .inf file and a .sys file and a couple of dll's.
to install the driver manually i do from elevated command prompt :
devcon install driver.inf HID\driver
I want some pointers on how to make the installer for this driver .
Thanks.
PS: I am a complete noob when it comes to things related to drivers.

We can use a simple installer based on NSIS that copies the files and executes the command . Also devcon binary is not redistibutable but we can copy parts of the devcon source that we need in order to create a specific driver installer binary.

Related

which file can install a program on windows 7?

Which of these files( in setup folder), if execute can install a program on windows 7 ?
1- setup.com
2-setup.ini
3-setup.inf
COM files are executable in Windows. You should be able to run setup.com from the CMD prompt by cding to the directory setup.com is in, and running setup or setup.com.
Keep in mind, COM files cannot be executed on 64-bit versions of Windows, since these editions lack NTVDM, the MS-DOS-emulating subsystem that handles COM file execution. You would instead need to emulate the 32-bit environment using an emulator like DOSBox.
setup.inf can be used to file copy and installation. I cannot remember setup.com installers for Windows programs.
msdn inf description

changing drivers through batch file

Is there a way to forcibly change drivers for particular devices in a batch file?
What my issue is here is that I'm trying to automate the process of selecting the correct driver for a projector that is connected to a computer and right now the projector is turned on automatically after the computer is started through a batch file.
However generic drivers are selected instead of the proper driver for that projector.
Is there a command I can use to forcibly change the driver for that projector or is there another way to change the default driver from the generic to the one I need automatically rather than manually?
In your batch file you need to find out:
Windows x86 (32 bit) or Windows x64 (64 bit) for example with:
if "%ProgramFiles(x86)%" == "" goto Driver32Bit
:Driver64Bit
echo Detected Windows x64
rem Commands for installing correct 64 bit driver after determining Windows version.
goto :EOF
:Driver32Bit
echo Detected Windows x86
rem Commands for installing correct 32 bit driver after determining Windows version.
goto :EOF
Windows version using command ver for selecting correct driver directory.
In each directory containing the driver files for appropriate Windows there should be dpinst32.exe or dpinst64.exe to install the driver. See Driver Package Installer (DPInst) for details about this free Microsoft application for installing drivers.
Very often the manufacturer of the driver delivers the driver packages already with dpinst32.exe and dpinst64.exe as often used by their own driver installers, too. Otherwise you need to download Windows Driver Kit and extract those two files from WDK package. Installing WDK is not necessary.

Signed ghostscript postscript print driver

I am using the Windows postscript print driver that is shipped with ghostscript (lib/ghostpdf.inf) to generate postscript files from print jobs.
However the postscript driver is not digitally signed, so Windows 8 and Windows Server 2012 won't allow installing it without booting into the "allow unsigned drivers"-mode.
Do you know if there is any signed version out there to be used with the latest Windows versions?
If thats not the case, I am fine compiling and signing it myself, however I was not able to find the source code for the postscript print driver within the git repo available at http://git.ghostscript.com/ghostpdl.git.
May I've just overseen it since I am not familiar with building drivers.
Can one give me a hint where I can find the postscript driver files to compile it myself?
EDIT: How does the .INF file tell windows where the driver binaries are located? I've looked into the "ClassGUID" however its the same for all drivers and the registry entry says something about C:\Windows\System32\ntprint.dll. I don't think this is important for the problem, is it?
To sign "the ghostscript driver" you just have to sign the INF-file that comes with Ghostscript.
There's an article on technet describing the steps required to do so.
The steps are:
1) Create/acquire a certificate
2) Ensure that your computer trusts the certificate (place it in your cert store if required)
3) Download and install the Windows Driver Kit (WDK)
4) Change the CatalogFile=oemprint.cat in the INF file to ghostpdf.cat
5) Change the DriverVer=01/02/2007,1.0.0.1 to DriverVer=01/01/2013,1.0.0.1 (maybe you need some other date, you'll see that in the next step)
6) Use the Inf2Cat tool to create a cat file (was at C:\Program Files (x86)\Windows Kits\8.0\bin\x86 for me):
NOTE
Use cmd.exe not powershell, as powershell gives Parameter format not correct. error all the time
Command:
inf2cat.exe /driver:c:\path\to\folder\whereCatFileIsIn /os:7_X86,7_X64,8_X86,8_X64[,other OS you'd like to support]
7) Sign the cat file using the signtool (Same directory as the Inf2Cat tool)
Command:
SignTool.exe sign /f "C:Path\to\my.pfx" /t http://timestamp.verisign.com/scripts/timestamp.dll "C:\Path\To\ghostpdf.cat"
(See the signtool docs for more informations about the available paramters)
.inf files are not drivers, they are just text files with some installer information. There is no signed version of this, nor do you need it, you can use the output of any PostScript driver with Ghostscript.
You can't compile a .inf file, because there is nothing to compile, I have no idea how you go about signing such a thing in the latest versions of Windows, but if you want to give it a try you can open the .inf file with a text editor.
Q: Do you know if there is any signed version out there to be used with the latest Windows versions?
* Workaround *
A: For my Postscript driver issue I re-used the already signed driver from freeware PDF generator PDFil Writer.
https://www.pdfill.com/freewriter.html
In my case, I am a Sybase Powerbuilder developer, and my application depends on the Ghostscript Postscript driver.
I hope this helps.

zip/compression command under Windows environment for COBOL program

I need to issue a zip/compression command from a COBOL program running on Windows platform, is there any built-in Windows specific command line command to zip the list of specified files, I cannot rely on 3rd party zip tools like winzip or 7zip.
I have tried compact command, is there any other alternatives to achieve this? please suggest.
Use zip.exe and unzip.exe available from http://www.info-zip.org/. The windows binaries can be downloaded directly from http://sourceforge.net/projects/infozip/files/.

Is it possible to unzip .ZIP file using .BAT command on Windows XP?

Is it possible to unzip .ZIP file using .BAT command on Windows XP? we have file.zip how to create a .BAT commands file to unzip\unpack it to some folder. USING ONLY NATIVE WINDOWS XP programms and commands.
So.. How to do such thing? (code example, please)
Yes.
But it involves using "scripting" and the use of System.FileSystemObject (a good keyword). You should be able to use cscript/WSH which can run VBScript or JScript (WSH 5.6 comes with XP). The general idea is here. There are some other interesting "issues" with this approach though; the operations runs asynchronously and the compression dialog box may appear -- but it can be done using standard XP tools.
I would recommend downloading 7-zip. It is a 200~400k standalone command-line executable (depending on version), but it requires an initial "install" to grab the executable first. You don't need the GUI to run 7-zip.
Short answer: No.
Explanation: https://serverfault.com/questions/39071/does-windows-have-a-built-in-zip-command-for-the-command-line
No, there is no command line support for the native zip/unzip library that comes with windows XP. The only solution would be to use a uncompressing library.

Resources