PDA

View Full Version : Driver service



jameswnl
05-07-2004, 07:44 PM
Hi there,

A newbie's question,

How can I install a driver service? I know not by windows installer project.

Can script project do that?

thanks

johnludlow
05-08-2004, 05:33 AM
I'm not sure what you mean by "driver service". Do you mean a Windows NT service? Do you mean a hardware driver that has a .inf file? Is it a combination of both?

To set up an NT service in a Basic MSI project (it's possible to do the same in a script project, but I don't know how. I know it involves calling some of the service functions - look in the help), go to the components view in the Installation Designer, right click the Components node (at the top) and select Component Wizard. Choose to specify the type of component, then choose InstallService, and answer the questions the wizard presents.

You should also do the same again, but this time choose ControlService, rather than InstallService, since this will now allow you to set the actions that are performed on installation and uninstallation (such as starting or stopping the service).

There is a better way of doing this, but it's more complicated. Both ways work, though.

To install a driver, you need to run the Device Driver Wizard. You can get to this by right clicking a feature in the Setup Design view and selecting Device Driver Wizard.

Hope that helps.

jameswnl
05-10-2004, 08:51 AM
Thx for reply.

The "driver service" is of a .sys file which will be first copied to system32\drivers and followed by installing a NT service which has type=SERVICE_KERNEL_DRIVER

I've found in the help that this type of service is not supported. The help categoriises it as "Driver service".

Probably for this kind of service, I can't do it thru standard facilities of IS, but custom code.

johnludlow
05-10-2004, 09:52 AM
Ah, right, I see. If you want this to be included, go to the feedback form (http://www.installshield.com/#footer) and put in a feature request (click the ask us a question link).

jameswnl
05-11-2004, 09:35 AM
Thanks John.

I wrote a program to install the driver. It actually call the windows API function,

CreateService(
scmHandle, //service manager
DRIVERNAME,
DRIVERNAME,
SERVICE_ALL_ACCESS,
SERVICE_KERNEL_DRIVER,
SERVICE_BOOT_START,
SERVICE_ERROR_NORMAL,
driverPath,
"Filter", // load group
NULL,
NULL,
NULL,
NULL );

I tried to come up with a custom action to call this program and have some questions,

1. when running, the screen will flash with a cmd screen and goes away. How to deal with it so that it run silently.

2. Since the program is a simple one, can I do it using Jscript and call createService()

3. How can I associate the action with a component (so that when in/uninstalling, it'll be executed)
3.1. I have another program to do the uninstallation, how to put it together?

I think these questions are about how-to on custom actions and must have answers somewhere. But I have done some search and couldn't find them.

Anyone pls help point me there.

Is there any doc/tutorial that will go thru custom action authoring? All the stuff in the HelpNet seems either too basic-concept oriented or assuming you have known pretty much about custom actions.

thanks in advance

johnludlow
05-11-2004, 11:27 AM
Dunno about 1 or 2, but I can answer 3.

You can use a component or feature state in a custom action condition. Look for "conditional expressions [Windows Installer]" in the DevStudio help and scroll down to the bit con component and feature states. Something like

$ComponentName=3

Depending on when you want the CA to run.

As for running a CA during the uninstallation, you can check the REMOVE property to see what's been removed (at a feature level).

jameswnl
05-12-2004, 06:00 PM
John, thx. The check of =3 works.

I actually check against the &featureName =3.

And I found out when a feature is being uninstalled (so far from my test cases),
&featureName =2. I also add some more checkings:

(REMOVE="ALL AND &featureName=2) OR REMOVE="featureName"

For silent running of CA, I use the "calling function from a standard DLL". It works even I didn't check the box of "Silent".

Thx again!