var
VclApplication: TApplication;
ServiceApplication: TServiceApplication;
begin
if WebRequestHandler <>
nil then
WebRequestHandler.WebModuleClass := TLogServerDataModule;
if FindCmdLineSwitch('
config')
then // normal application with config dialog only
begin
VclApplication :=
Vcl.Forms.Application;
VclApplication.Initialize;
VclApplication.MainFormOnTaskbar := True;
VclApplication.CreateForm(TfrmLogServerConfigDlg, frmLogServerConfigDlg);
VclApplication.Run;
end
else if not AnsiSameText(GetParentProcessName, '
services.exe')
and not FindCmdLineSwitch('
install')
and not FindCmdLineSwitch('
uninstall')
then // normal application
begin
VclApplication :=
Vcl.Forms.Application;
VclApplication.Initialize;
VclApplication.MainFormOnTaskbar := True;
VclApplication.CreateForm(TfrmLogServerTestMain, frmLogServerTestMain);
VclApplication.CreateForm(TLogServerDataModule, LogServerDataModule);
LogServerDataModule.RunningAsService := False;
VclApplication.Run;
end
else // service
begin
ServiceApplication :=
Vcl.SvcMgr.Application;
if not ServiceApplication.DelayInitialize
or ServiceApplication.Installing
then
ServiceApplication.Initialize;
ServiceApplication.CreateForm(TDemoServer, DemoServer);
ServiceApplication.CreateForm(TLogServerDataModule, LogServerDataModule);
LogServerDataModule.RunningAsService := True;
ServiceApplication.Run;
end;