Skip to content

Commit

Permalink
With application logging enabled, automatic updates installation is s…
Browse files Browse the repository at this point in the history
…tarted with logging too

Source commit: 495f301b4648efcdb080dfc608d4de8e8ec85c79
  • Loading branch information
martinprikryl committed Aug 20, 2023
1 parent 6f231ac commit eb27408
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/core/SessionInfo.cpp
Expand Up @@ -1793,7 +1793,8 @@ TApplicationLog::~TApplicationLog()
void TApplicationLog::Enable(const UnicodeString & Path)
{
UnicodeString Dummy;
FFile = OpenFile(Path, Now(), NULL, false, Dummy);
FPath = Path;
FFile = OpenFile(FPath, Now(), NULL, false, Dummy);
FLogging = true;
}
//---------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions source/core/SessionInfo.h
Expand Up @@ -370,8 +370,10 @@ class TApplicationLog
void AddStartupInfo();
void __fastcall Log(const UnicodeString & S);
__property bool Logging = { read = FLogging };
__property UnicodeString Path = { read = FPath };

private:
UnicodeString FPath;
void * FFile;
bool FLogging;
std::unique_ptr<TCriticalSection> FCriticalSection;
Expand Down
5 changes: 5 additions & 0 deletions source/windows/Setup.cpp
Expand Up @@ -1400,10 +1400,15 @@ void __fastcall TUpdateDownloadThread::UpdateDownloaded()
{
Params += L" /OpenGettingStarted";
}
if (ApplicationLog->Logging)
{
Params += FORMAT(" /LOG=\"%s\"", (ApplicationLog->Path + L".setup"));
}

ExecuteShellChecked(SetupPath, Params);

Configuration->Usage->Inc(L"UpdateRuns");
AppLog(L"Terminating to allow installation...");
TerminateApplication();
}
//---------------------------------------------------------------------------
Expand Down

0 comments on commit eb27408

Please sign in to comment.