-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathServiceParameters.pas
48 lines (38 loc) · 1.04 KB
/
ServiceParameters.pas
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
40
41
42
43
44
45
46
unit ServiceParameters;
interface
Uses types,SysUtils,Classes;
function GetTitle:string;
var
ServiceName: String;
AppName: String;
ServiceDescription: String;
_User: String;
_Password: String;
Settings: TStrings;
_IniFileName: String;
implementation
function GetTitle:string;
begin
{$IFDEF WIN64}
result:=' (64bit)';
{$ELSE}
result:=' (32bit)';
{$ENDIF}
end;
initialization
Settings := TStringList.Create;
_IniFileName:=ChangeFileExt(ParamStr(0), '.ini');
if FileExists(_IniFileName) then
begin
Settings.LoadFromFile(ChangeFileExt(ParamStr(0), '.ini'));
ServiceName := Settings.Values['ServiceName'];
AppName := Settings.Values['AppName'];
ServiceDescription := Settings.Values['ServiceDescription'];
Settings.delimiter:=' ';
Settings.DelimitedText:=cmdline;
_User:= Settings.Values['USER'];
_PASSWORD:= Settings.Values['PASSWORD'];
end;
finalization
FreeAndNil(Settings);
end.