How do I log application update events using TMS TwebUpdate?
I'm trying to get a log of actions taken during an application update using the TMS component TWebUpdate mentioned in several SO posts. I'm using TWebUpdate ver 184.108.40.206 and Delphi 2009 under Windows 7 (although the application is used on many OS.)
There is nothing is wrong with doing the update and when
Twebupdate.logging := true and
Twebupdate.filename := 'update.log' then I correctly get several pages of full logging of into a textfile called update.log, ending, if the application restarts, with something like
'22/05/2020 09:05:10 :  UPD has EXE restarted'
However, I already have a txt file called 'appln.log' into which I am appending (by opening, appending and closing) other events that happen in my application so I don't want two logs.
If I change the log filename in TWebUpdate to the same txt file I am already using to log these other events in my application (by using
Twebupdate.filename := 'appln.log') then instead of TwebUpdate inserting into appln.log all of the log events that is previously put into update.log it only inserts the last line e.g.
<other application log lines> '22/05/2020 09:52:10 :  UPD has EXE restarted' <other application log lines>
The documentation says for the event OnProgress
OnProgress(Sender: TObject; Action: String); Event triggered for each step during the web update. Action indicates what is happening.
So I tried instead to use the TwebUpdate.OnProgress event to log every action into my existing application log file by using the same logging call that I make elsewhere in my application e.g.
procedure TFrm_UpdateApplication.WebUpdate1Progress(Sender: TObject; Action: string); begin WriteToLog('WEBUPDATE -> ' + action); end;
However this time nothing was written out at all (whether
Twebupdate.logging := true or
Twebupdate.logging := false) and a break point placed in this event showed it is never being called.
How can I get the full update log appended to my existing application log at the point when Twebupdate executes it's code?