Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Question on installing driver file


3 replies to this topic

Peter Bi

Peter Bi
  • Members
  • 68 posts

Posted 14 January 2002 - 23:28

Hi,

I am using ID7.02 Basics, target machine is W2K.
I need to install a driver file with extention .sys, how should I do it?
What kind of component it should be? Can I install it as an NTService component? (using component wizard can't make it InstallNTService, since the wizard only browse/link .exe file).
I am not familiar with driver files, should I start a driver after installing it?

Thanks,
Peter


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 15 January 2002 - 00:01

You can not use the NTService component.  You are not able to specify the necessary parameters with it.

How you proceed depends upon the driver.  If it is a legacy driver you can install it to the windows\system32\drivers directory then use the Service Control Manager Win32 functions to create the necessary registry keys and start the driver.  Alternately create the registry keys and reboot.

If it is proper plug and play driver your driver author will have written an INF file.  You then need to write a custom action to call SetupDi... functions to process the INF file.  There is an example of this in the Windows 2000 DDK.


Peter Bi

Peter Bi
  • Members
  • 68 posts

Posted 15 January 2002 - 01:19

Thank you so much, Ian.

Yours is the only reply so far, could you please give more info on legacy driver installation?

I am coverting an IS5.5 package to Dev7, but there is nobody I can turn to on how the driver should be handled. The only ref I have is to install the old package and see what regs/files are created/installed.  You knowledge is definitely help to me. Can you specially explain how to "use the Service Control Manager Win32 functions to create the necessary registry keys and start the driver"? This way can avoid reboot, right?

Thanks again,
Peter


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 15 January 2002 - 12:41

It is difficult to give you speciifc information because that all depends upon your driver.

Step 1.   Call OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE)
This will  return a handle to the Service control manager.
Step 2.  Call CreateService the parameters depend on your driver. Access should be SERVICE_START.
This will create the driver entry in the registry and return a handle to the driver eg hMyDriver
Step 3.  Call StartService(hMyDriver, 0, NULL);
If your driver can start it will.
Step 4. Close all the handles.

I use C DLLs but you can use InstallScript but I do not know the details.