1. Add the PureCoverage program and cache directories to your system Path environment variable. (Note: For a system service, it is important to add these directories to your system Path environment variable, not just your user Path environment variable.)
2. Reboot your machine so the system uses the new value.
3. Instrument the program without running it. For example, from the command line, type: coverage /Run=no /Out=service_app_pure.exe service_application.exe.
4. Use Regedit.exe to edit the ImagePath registry value for the appropriate service under the key: \HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services and change the name to the instrumented program. For example, service_app_pure.exe, using the program's full path name. (Some systems require you to be an administrator to change these keys.)
5. It is recommended that you start the PureCoverage user interface before starting the Service to guarantee that the results are displayed there. This is due to the fact that some Services are not allowed to start other programs, or it's used in a remote terminal session, or due to various other security restrictions.
6. Double-click the Services icon in the Control Panel, select the service you want, and then click Startup.
7. In the Service dialog box, select Allow Service to Interact with Desktop. (This way, PureCoverage is visible while you run the service.)
8. Select Manual, and then click OK.
9. In the Services dialog box, click Start. This launches the instrumented service program, which launches PureCoverage, if needed.
Notes:
§ To fix coverage problems in an instrumented service, stop the service before reinstrumenting the new version and then restart the service.
§ Sometimes the increased delay in starting an instrumented service causes the system to shut the service down. One work around is to pre-start the PureCoverage user interface while logged on as the system user or administrator.
§ If you start the PureCoverage user interface from a remote terminal session and plan to hook it up with a system service, you should also set the additional environment variable in the SYSTEM environment: PURE_USE_GLOBAL_NAMESPACE=1
§ Sample service code is included with the product. Please refer to the <install_dir>/Samples/NativeService directory.
(C) Copyright IBM Corporation 1993, 2010.