-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathraas.dpr
39 lines (34 loc) · 1.14 KB
/
raas.dpr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
program raas;
uses
Vcl.SvcMgr,
SysUtils,
windows,
ServiceTools in 'ServiceTools.pas',
SVCMainUn in 'SVCMainUn.pas' {AgentSvc: TService},
DMUn in 'DMUn.pas' {DM: TDataModule},
ServiceUn in 'ServiceUn.pas',
RegisterMessages in 'RegisterMessages.pas',
ServiceParameters in 'ServiceParameters.pas';
{$R *.res}
{$R 'MessageFile.res'}
{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE or IMAGE_FILE_RELOCS_STRIPPED}
begin
if FindCmdLineSwitch('STOP') then
begin
if ServiceRunning('', AnsiUpperCase(ServiceName)) then
ServiceStop('', AnsiUpperCase(ServiceName));
exit;
end;
if FindCmdLineSwitch('INSTALL') then
if ServiceExists('', AnsiUpperCase(ServiceName)) then exit;
if FindCmdLineSwitch('UNINSTALL') then
if ServiceExists('', AnsiUpperCase(ServiceName))=false then exit;
if not Application.DelayInitialize or Application.Installing then
Application.Initialize;
Application.CreateForm(TAgentSvc, AgentSvc);
AgentSvc.Description:=ServiceDescription;
AgentSvc.DisplayName:=ServiceDescription+GetTitle;
AgentSvc.Name:=LowerCase(ServiceName);
RegisterMessageFile(AgentSvc.Name);
Application.Run;
end.