|
@@ -999,6 +999,7 @@ void TCustomScpExplorerForm::CheckStoreTransition()
|
|
else if ((WinConfiguration->StoreTransition == stStandard) && IsUWP())
|
|
else if ((WinConfiguration->StoreTransition == stStandard) && IsUWP())
|
|
{
|
|
{
|
|
WinConfiguration->StoreTransition = stStoreMigrated;
|
|
WinConfiguration->StoreTransition = stStoreMigrated;
|
|
|
|
+ WinConfiguration->FirstRun = WinConfiguration->FirstRun + L"=>" + StandardDatestamp();
|
|
AppLog(L"Standard installation migrated to store installation");
|
|
AppLog(L"Standard installation migrated to store installation");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -9148,40 +9149,59 @@ void __fastcall TCustomScpExplorerForm::StartUpdates()
|
|
// first run after installation
|
|
// first run after installation
|
|
if (double(Updates.LastCheck) == 0)
|
|
if (double(Updates.LastCheck) == 0)
|
|
{
|
|
{
|
|
|
|
+ AppLog(L"First run, scheduling updates check for the next run");
|
|
// make sure next time there will be an update (if enabled)
|
|
// make sure next time there will be an update (if enabled)
|
|
Updates.LastCheck = TDateTime(1);
|
|
Updates.LastCheck = TDateTime(1);
|
|
WinConfiguration->Updates = Updates;
|
|
WinConfiguration->Updates = Updates;
|
|
}
|
|
}
|
|
- else if ((double(Updates.Period) > 0) &&
|
|
|
|
- (Now() - Updates.LastCheck >= Updates.Period))
|
|
|
|
|
|
+ else
|
|
{
|
|
{
|
|
- TThreadMethod OnUpdatesChecked = NULL;
|
|
|
|
- if (!IsUWP())
|
|
|
|
|
|
+ TDateTime Period;
|
|
|
|
+ if (IsUWP() && !IsOfficialPackage())
|
|
|
|
+ {
|
|
|
|
+ Period = DefaultUpdatesPeriod;
|
|
|
|
+ AppLog(L"Thirdparty UWP package, using default updates check period");
|
|
|
|
+ }
|
|
|
|
+ else
|
|
{
|
|
{
|
|
- OnUpdatesChecked = UpdatesChecked;
|
|
|
|
|
|
+ Period = Updates.Period;
|
|
|
|
+ }
|
|
|
|
+ AppLogFmt(L"Updates check period: %.2f", (double(Period)));
|
|
|
|
+ if (double(Period) > 0)
|
|
|
|
+ {
|
|
|
|
+ TDateTime Interval = Now() - Updates.LastCheck;
|
|
|
|
+ AppLogFmt(L"Interval since the last updates check: %.2f", (double(Interval)));
|
|
|
|
+ if (Interval >= Period)
|
|
|
|
+ {
|
|
|
|
+ StartUpdateThread(UpdatesChecked);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- StartUpdateThread(OnUpdatesChecked);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
//---------------------------------------------------------------------------
|
|
void __fastcall TCustomScpExplorerForm::UpdatesChecked()
|
|
void __fastcall TCustomScpExplorerForm::UpdatesChecked()
|
|
{
|
|
{
|
|
|
|
+ AppLog(L"Updates check done");
|
|
UnicodeString Message;
|
|
UnicodeString Message;
|
|
bool New;
|
|
bool New;
|
|
TQueryType Type;
|
|
TQueryType Type;
|
|
GetUpdatesMessage(Message, New, Type, false);
|
|
GetUpdatesMessage(Message, New, Type, false);
|
|
if (!Message.IsEmpty())
|
|
if (!Message.IsEmpty())
|
|
{
|
|
{
|
|
|
|
+ AppLogFmt(L"Updates check message: %s", (Message));
|
|
if (New)
|
|
if (New)
|
|
{
|
|
{
|
|
|
|
+ AppLog(L"New version detected");
|
|
Message = FMTLOAD(NEW_VERSION_CLICK, (Message));
|
|
Message = FMTLOAD(NEW_VERSION_CLICK, (Message));
|
|
}
|
|
}
|
|
if (!New && (Type != qtWarning))
|
|
if (!New && (Type != qtWarning))
|
|
{
|
|
{
|
|
|
|
+ AppLog(L"Posting non-critical updates note");
|
|
PostNote(UnformatMessage(Message), 0, UpdatesNoteClicked, NULL);
|
|
PostNote(UnformatMessage(Message), 0, UpdatesNoteClicked, NULL);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
|
|
+ AppLog(L"Posting new version or critical message notification");
|
|
Notify(NULL, Message, Type, true, UpdatesNoteClicked);
|
|
Notify(NULL, Message, Type, true, UpdatesNoteClicked);
|
|
}
|
|
}
|
|
|
|
|