This code is part of «VDF GUIdance»
Visit us @ http://www.vdf-guidance.com
e-Mail us @ info@vdf-guidance.com
VDF GUIdance is a mutual project of
Frank Vandervelpen - Vandervelpen Systems and
Wil van Antwerpen - Antwise Solutions

Software running as a service on NT

Author: Frank G. Vandervelpen (Original published as a web White paper)

Ownership: Mutual project of Vandervelpen Systems and Antwise solutions

DataFlex-version: 4.0/5.0/6.0 (VDF)

Purpose

This document describes the way to migrate a software (i.e. a VDF program) towards a service on Microsoft Windows NT4.0 ®. There are a lot of reasons why this could be done. Suppose we want software of us running continuously, even when someone is not logged in. This can be for security sake. A second argument to do this is because people want to make backups. Sometimes, it is hard to make backups when a software is running and it might be locking databases and blocking other things. Whenever you have a good backup, or when you have a script for running automatic backups, you can unload and reload a service from within this kind of environment. We have had a special request of one of our customers to implement this as I describe it here. At this stage, we do not exactly know how VDF is reacting on a service, but we’ll find out really soon.

Responsibility

This document can be used as a feedback document, but you have to double-check everything. We are not responsible for direct or indirect faults or loss to hardware, software or data on your information system.

Requirements

We have done our project on a Windows NT 4.0 ® Int’l Edition Server with Support Pack 3. In addition we have installed the Microsoft Windows NT 4.0 ® Resource kit.

Services do…

Note

As far as I could understand you can not run a user-data entry and network aware software in one service. You have to make a choice between those.

Steps to Follow

The next part will show you an example of the registry settings for such a service definition of a program.

REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WANExchange]
"Type"=dword:00000110
"Start"=dword:00000002
"ErrorControl"=dword:00000001
"DisplayName"="WANExchange"
"ObjectName"="LocalSystem"
"ImagePath"=hex(2):63,3a,5c,6e,74,52,65,73,6b,69,74,5c,73,72,76,61,6e,79,2e,65,\
78,65,00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WANExchange\Parameters]
"AppParameters"="WANexchange.vdf"
"AppDirectory"="H:\\accoflex\\mits\\wan\\programs\\"
"Application"="H:\\accoflex\\Mits\\Wan\\Programs\\Dfrun.exe"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WANExchange\Security]
"Security"=hex:01,00,14,80,c0,00,00,00,cc,00,00,00,14,00,00,00,34,00,00,00,02,\
00,20,00,01,00,00,00,02,80,18,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
00,00,20,02,00,00,02,00,8c,00,05,00,00,00,00,00,18,00,8d,01,02,00,01,01,00,\
00,00,00,00,01,00,00,00,00,f8,00,14,00,00,00,1c,00,fd,01,02,00,01,02,00,00,\
00,00,00,05,20,00,00,00,23,02,00,00,06,00,00,00,00,00,1c,00,ff,01,0f,00,01,\
02,00,00,00,00,00,05,20,00,00,00,20,02,00,00,06,00,00,00,00,00,1c,00,ff,01,\
0f,00,01,02,00,00,00,00,00,05,20,00,00,00,25,02,00,00,06,00,00,00,00,00,18,\
00,fd,01,02,00,01,01,00,00,00,00,00,05,12,00,00,00,25,02,00,00,01,01,00,00,\
00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WANExchange\Enum]
"0"="Root\\LEGACY_WANEXCHANGE\\0000"
"Count"=dword:00000001
"NextInstance"=dword:00000001