summaryrefslogtreecommitdiff
path: root/packages/fcl-extra
diff options
context:
space:
mode:
authormichael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2>2013-05-07 08:05:39 +0000
committermichael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2>2013-05-07 08:05:39 +0000
commitc2f7a5719b0deca0d3d7de937e911ed1db3acb90 (patch)
treeb4135c2e2fb2708e8fb02cbb8c7c15245231568b /packages/fcl-extra
parent1ee53bcc3ac232172004338894fc769451dca385 (diff)
downloadfpc-c2f7a5719b0deca0d3d7de937e911ed1db3acb90.tar.gz
* Allow disable of registering of message file
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@24457 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/fcl-extra')
-rw-r--r--packages/fcl-extra/src/daemonapp.pp18
1 files changed, 14 insertions, 4 deletions
diff --git a/packages/fcl-extra/src/daemonapp.pp b/packages/fcl-extra/src/daemonapp.pp
index bf9abcbd7e..555bb80c6e 100644
--- a/packages/fcl-extra/src/daemonapp.pp
+++ b/packages/fcl-extra/src/daemonapp.pp
@@ -335,6 +335,7 @@ Type
FRunMode: TDaemonRunMode;
FSysData: TObject;
FControllerCount : Integer;
+ FAutoRegisterMessageFile : Boolean;
procedure BindDaemonDefs(AMapper: TCustomDaemonMapper);
function InstallRun: Boolean;
procedure SysInstallDaemon(Daemon: TCustomDaemon);
@@ -362,6 +363,7 @@ Type
procedure DoLog(EventType: TEventType; const Msg: String); override;
Property SysData : TObject Read FSysData Write FSysData;
Public
+ Constructor Create(AOwner : TComponent); override;
destructor Destroy; override;
Procedure ShowException(E : Exception); override;
Function CreateDaemon(DaemonDef : TDaemonDef) : TCustomDaemon;
@@ -376,6 +378,7 @@ Type
Property GUIMainLoop : TGuiLoopEvent Read FGUIMainLoop Write FGuiMainLoop;
Property GuiHandle : THandle Read FGUIHandle Write FGUIHandle;
Property RunMode : TDaemonRunMode Read FRunMode;
+ Property AutoRegisterMessageFile : Boolean Read FAutoRegisterMessageFile Write FAutoRegisterMessageFile default true;
end;
TCustomDaemonApplicationClass = Class of TCustomDaemonApplication;
@@ -692,7 +695,6 @@ end;
{ TCustomServiceApplication }
-
procedure TCustomDaemonApplication.CreateServiceMapper(Var AMapper : TCustomDaemonMapper);
begin
@@ -794,7 +796,6 @@ Var
begin
FrunMode:=drmInstall;
- EventLog.RegisterMessageFile('');
SysStartInstallDaemons;
try
FMapper.DoOnInstall;
@@ -826,7 +827,8 @@ Var
begin
FrunMode:=drmUnInstall;
- EventLog.UnRegisterMessageFile;
+ if FAutoRegisterMessageFile then
+ EventLog.UnRegisterMessageFile;
SysStartUnInstallDaemons;
Try
FMapper.DoOnUnInstall;
@@ -919,7 +921,8 @@ begin
begin
FEventLog:=TEventlog.Create(Self);
FEventLog.RaiseExceptionOnError:=False;
- FEventLog.RegisterMessageFile('');
+ if FAutoRegisterMessageFile then
+ FEventLog.RegisterMessageFile('');
end;
result := FEventLog;
end;
@@ -932,6 +935,13 @@ begin
inherited Destroy;
end;
+constructor TCustomDaemonApplication.Create(AOwner : TComponent);
+
+begin
+ inherited;
+ FAutoRegisterMessageFile:=True;
+end;
+
procedure TCustomDaemonApplication.DoRun;
begin