From 5e2c8b5e72db5c668d79769a9aac1a574b7fd787 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sun, 28 Dec 2025 13:36:47 +0100 Subject: [PATCH] chore: remove notification for no longer created build updates --- source/apphelpers.pas | 2 +- source/main.pas | 6 +- source/preferences.lfm | 41 ++++--------- source/preferences.pas | 4 -- source/updatecheck.lfm | 126 ++++++++------------------------------- source/updatecheck.pas | 131 ++--------------------------------------- 6 files changed, 45 insertions(+), 265 deletions(-) diff --git a/source/apphelpers.pas b/source/apphelpers.pas index 209d719c..a5c03b36 100644 --- a/source/apphelpers.pas +++ b/source/apphelpers.pas @@ -3752,7 +3752,7 @@ begin InitSetting(asCSVImportParseMethod, 'CSVImportParseMethod', 0); InitSetting(asCSVKeepDialogOpen, 'CSVKeepDialogOpen', 0, False); InitSetting(asUpdatecheck, 'Updatecheck', 0, False); - InitSetting(asUpdatecheckBuilds, 'UpdatecheckBuilds', 0, False); + // Removed: InitSetting(asUpdatecheckBuilds, 'UpdatecheckBuilds', 0, False); InitSetting(asUpdatecheckInterval, 'UpdatecheckInterval', 3); InitSetting(asUpdatecheckLastrun, 'UpdatecheckLastrun', 0, False, DateToStr(DateTimeNever)); InitSetting(asUpdateCheckWindowWidth, 'UpdateCheckWindowWidth', 400); diff --git a/source/main.pas b/source/main.pas index 853dcd43..43d8aadd 100644 --- a/source/main.pas +++ b/source/main.pas @@ -2179,11 +2179,9 @@ begin frm.btnCancel.Caption := _('Skip'); try frm.ReadCheckFile; - // Show the dialog if release is available, or - when wanted - build checks are activated - if (AppSettings.ReadBool(asUpdatecheckBuilds) and frm.btnBuild.Enabled) - or frm.LinkLabelRelease.Enabled then begin + // Show the dialog if release is available + if frm.LinkLabelRelease.Enabled then frm.ShowModal; - end; except on E:Exception do LogSQL(f_('Error when checking for updates: %s', [E.Message])); diff --git a/source/preferences.lfm b/source/preferences.lfm index 6c964ee8..c83b7026 100644 --- a/source/preferences.lfm +++ b/source/preferences.lfm @@ -11,7 +11,6 @@ object frmPreferences: TfrmPreferences Constraints.MinWidth = 375 DesignTimePPI = 120 Position = poMainFormCenter - LCLVersion = '4.2.0.0' OnClose = FormClose OnCreate = FormCreate OnDestroy = FormDestroy @@ -177,22 +176,6 @@ object frmPreferences: TfrmPreferences Text = '1' OnChange = Modified end - object chkUpdateCheckBuilds: TCheckBox - AnchorSideLeft.Control = editUpdatecheckInterval - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = chkRestoreLastDB - AnchorSideTop.Side = asrBottom - Left = 557 - Height = 24 - Top = 100 - Width = 290 - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Around = 6 - Caption = 'Also check for updated nightly builds' - Enabled = False - TabOrder = 5 - OnClick = Modified - end object chkDoStatistics: TCheckBox AnchorSideTop.Control = editUpdatecheckInterval AnchorSideTop.Side = asrBottom @@ -204,7 +187,7 @@ object frmPreferences: TfrmPreferences Anchors = [akTop, akLeft, akRight] BorderSpacing.Around = 6 Caption = 'Send usage statistics' - TabOrder = 6 + TabOrder = 5 OnClick = Modified end object chkAllowMultiInstances: TCheckBox @@ -229,7 +212,7 @@ object frmPreferences: TfrmPreferences Width = 251 BorderSpacing.Around = 6 Caption = 'Display bars in various list columns' - TabOrder = 8 + TabOrder = 7 OnClick = Modified end object editMySQLBinaries: TEditButton @@ -249,7 +232,7 @@ object frmPreferences: TfrmPreferences MaxLength = 0 NumGlyphs = 1 PasswordChar = #0 - TabOrder = 9 + TabOrder = 8 Text = 'editMySQLBinaries' TextHint = 'Find mysql.exe directory' OnButtonClick = editMySQLBinariesRightButtonClick @@ -270,7 +253,7 @@ object frmPreferences: TfrmPreferences BorderSpacing.Around = 6 ItemHeight = 20 Style = csDropDownList - TabOrder = 11 + TabOrder = 10 OnClick = Modified end object editCustomSnippetsDirectory: TEditButton @@ -290,7 +273,7 @@ object frmPreferences: TfrmPreferences MaxLength = 0 NumGlyphs = 1 PasswordChar = #0 - TabOrder = 10 + TabOrder = 9 Text = 'editCustomSnippetsDirectory' TextHint = 'Set custom directory for SQL snippet files' OnButtonClick = editCustomSnippetsDirectoryRightButtonClick @@ -310,7 +293,7 @@ object frmPreferences: TfrmPreferences BorderSpacing.Around = 6 ItemHeight = 20 Style = csDropDownList - TabOrder = 12 + TabOrder = 11 OnChange = comboGUIFontChange end object editGUIFontSize: TEdit @@ -327,7 +310,7 @@ object frmPreferences: TfrmPreferences Anchors = [akTop, akRight] BorderSpacing.Around = 6 NumbersOnly = True - TabOrder = 13 + TabOrder = 12 Text = '8' OnChange = Modified end @@ -341,7 +324,7 @@ object frmPreferences: TfrmPreferences Anchors = [akTop, akLeft, akRight] BorderSpacing.Around = 6 Caption = 'Use Ctrl+Mousewheel for zooming' - TabOrder = 7 + TabOrder = 6 OnClick = Modified end object comboTheme: TComboBox @@ -358,7 +341,7 @@ object frmPreferences: TfrmPreferences ItemHeight = 20 Sorted = True Style = csDropDownList - TabOrder = 14 + TabOrder = 13 end object comboIconPack: TComboBox AnchorSideTop.Control = comboTheme @@ -373,7 +356,7 @@ object frmPreferences: TfrmPreferences BorderSpacing.Around = 6 ItemHeight = 20 Style = csDropDownList - TabOrder = 16 + TabOrder = 15 OnChange = Modified end object comboWebSearchBaseUrl: TComboBox @@ -398,7 +381,7 @@ object frmPreferences: TfrmPreferences 'https://www.bing.com/search?q=%query' 'https://www.google.com/search?q=%query' ) - TabOrder = 17 + TabOrder = 16 Text = 'comboWebSearchBaseUrl' OnChange = Modified end @@ -414,7 +397,7 @@ object frmPreferences: TfrmPreferences Anchors = [akTop, akRight] BorderSpacing.Around = 6 Caption = 'Preview' - TabOrder = 15 + TabOrder = 14 end end object tabLogging: TTabSheet diff --git a/source/preferences.pas b/source/preferences.pas index 2574f0fd..70604597 100644 --- a/source/preferences.pas +++ b/source/preferences.pas @@ -61,7 +61,6 @@ type chkRestoreLastDB: TCheckBox; chkUpdatecheck: TCheckBox; editUpdatecheckInterval: TEdit; - chkUpdateCheckBuilds: TCheckBox; SynSQLSynSQLSample: TSynSQLSyn; btnRestoreDefaults: TButton; lblMaxTotalRows: TLabel; @@ -341,7 +340,6 @@ begin AppSettings.WriteInt(asDataFontSize, MakeInt(editDataFontSize.Text)); AppSettings.WriteBool(asLogToFile, chkLogToFile.Checked); AppSettings.WriteBool(asUpdatecheck, chkUpdatecheck.Checked); - AppSettings.WriteBool(asUpdatecheckBuilds, chkUpdatecheckBuilds.Checked); AppSettings.WriteInt(asUpdatecheckInterval, MakeInt(editUpdatecheckInterval.Text)); AppSettings.WriteBool(asDoUsageStatistics, chkDoStatistics.Checked); AppSettings.WriteBool(asWheelZoom, chkWheelZoom.Checked); @@ -682,7 +680,6 @@ begin chkAllowMultiInstances.Checked := AppSettings.ReadBool(asAllowMultipleInstances); chkRestoreLastDB.Checked := AppSettings.ReadBool(asRestoreLastUsedDB); chkUpdatecheck.Checked := AppSettings.ReadBool(asUpdatecheck); - chkUpdatecheckBuilds.Checked := AppSettings.ReadBool(asUpdatecheckBuilds); editUpdatecheckInterval.Text := AppSettings.ReadInt(asUpdatecheckInterval).ToString; chkUpdatecheckClick(Sender); chkDoStatistics.Checked := AppSettings.ReadBool(asDoUsageStatistics); @@ -919,7 +916,6 @@ end; procedure TfrmPreferences.chkUpdatecheckClick(Sender: TObject); begin editUpdatecheckInterval.Enabled := chkUpdatecheck.Checked; - chkUpdatecheckBuilds.Enabled := chkUpdatecheck.Checked; Modified(Sender); end; diff --git a/source/updatecheck.lfm b/source/updatecheck.lfm index caf71872..a88e364c 100644 --- a/source/updatecheck.lfm +++ b/source/updatecheck.lfm @@ -1,33 +1,30 @@ object frmUpdateCheck: TfrmUpdateCheck Left = 0 - Height = 505 + Height = 300 Top = 0 Width = 450 Caption = 'Check for updates ...' - ClientHeight = 505 + ClientHeight = 300 ClientWidth = 450 Color = clBtnFace - Constraints.MinHeight = 500 + Constraints.MinHeight = 300 Constraints.MinWidth = 375 DesignTimePPI = 120 Position = poOwnerFormCenter - OnClose = FormClose OnCreate = FormCreate OnDestroy = FormDestroy OnShow = FormShow object lblStatus: TLabel AnchorSideLeft.Control = Owner - AnchorSideTop.Control = groupBuild AnchorSideTop.Side = asrBottom AnchorSideRight.Control = btnCancel AnchorSideBottom.Control = Owner AnchorSideBottom.Side = asrBottom Left = 6 - Height = 31 - Top = 468 - Width = 300 - Anchors = [akTop, akLeft, akRight, akBottom] - AutoSize = False + Height = 20 + Top = 274 + Width = 57 + Anchors = [akLeft, akBottom] BorderSpacing.Around = 6 Caption = 'lblStatus' Layout = tlCenter @@ -40,7 +37,7 @@ object frmUpdateCheck: TfrmUpdateCheck AnchorSideBottom.Side = asrBottom Left = 312 Height = 31 - Top = 468 + Top = 263 Width = 132 Anchors = [akRight, akBottom] BorderSpacing.Around = 6 @@ -48,87 +45,7 @@ object frmUpdateCheck: TfrmUpdateCheck Caption = 'Cancel' Default = True ModalResult = 2 - TabOrder = 3 - end - object groupBuild: TGroupBox - AnchorSideLeft.Control = Owner - AnchorSideTop.Control = groupRelease - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = Owner - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = btnCancel - Left = 6 - Height = 230 - Top = 232 - Width = 438 - Anchors = [akTop, akLeft, akRight, akBottom] - BorderSpacing.Around = 6 - Caption = 'Nightly build' - ClientHeight = 205 - ClientWidth = 434 - ParentBackground = False TabOrder = 2 - object btnBuild: TButton - AnchorSideLeft.Control = groupBuild - AnchorSideRight.Control = groupBuild - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = groupBuild - AnchorSideBottom.Side = asrBottom - Left = 6 - Height = 31 - Top = 168 - Width = 422 - Anchors = [akLeft, akRight, akBottom] - BorderSpacing.Around = 6 - Caption = 'Download nightly build' - Enabled = False - ModalResult = 1 - TabOrder = 2 - Visible = False - OnClick = btnBuildClick - end - object memoBuild: TMemo - AnchorSideLeft.Control = groupBuild - AnchorSideTop.Control = groupBuild - AnchorSideRight.Control = groupBuild - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = btnChangelog - Left = 6 - Height = 119 - Top = 6 - Width = 422 - Anchors = [akTop, akLeft, akRight, akBottom] - BorderSpacing.Around = 6 - BorderStyle = bsNone - Color = clBtnFace - Font.Color = clWindowText - Font.Height = -15 - Font.Name = 'Courier New' - Lines.Strings = ( - 'memoBuild' - ) - ParentFont = False - ReadOnly = True - ScrollBars = ssVertical - TabOrder = 0 - Visible = False - WordWrap = False - end - object btnChangelog: TButton - AnchorSideLeft.Control = groupBuild - AnchorSideRight.Control = groupBuild - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = btnBuild - Left = 6 - Height = 31 - Top = 131 - Width = 422 - Anchors = [akLeft, akRight, akBottom] - BorderSpacing.Around = 6 - Caption = 'View changelog' - TabOrder = 1 - OnClick = btnChangelogClick - end end object groupRelease: TGroupBox AnchorSideLeft.Control = Owner @@ -136,23 +53,29 @@ object frmUpdateCheck: TfrmUpdateCheck AnchorSideTop.Side = asrBottom AnchorSideRight.Control = Owner AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = btnCancel Left = 6 - Height = 122 + Height = 153 Top = 104 Width = 438 - Anchors = [akTop, akLeft, akRight] + Anchors = [akTop, akLeft, akRight, akBottom] BorderSpacing.Around = 6 Caption = 'Official release' - ClientHeight = 97 + ClientHeight = 128 ClientWidth = 434 Enabled = False ParentBackground = False TabOrder = 1 object memoRelease: TMemo - Left = 8 - Height = 59 - Top = 5 - Width = 417 + AnchorSideLeft.Control = groupRelease + AnchorSideTop.Control = groupRelease + AnchorSideRight.Control = groupRelease + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = LinkLabelRelease + Left = 6 + Height = 90 + Top = 6 + Width = 422 Anchors = [akTop, akLeft, akRight, akBottom] BorderSpacing.Around = 6 BorderStyle = bsNone @@ -165,10 +88,13 @@ object frmUpdateCheck: TfrmUpdateCheck TabOrder = 0 end object LinkLabelRelease: TLabel + AnchorSideLeft.Control = groupRelease + AnchorSideBottom.Control = groupRelease + AnchorSideBottom.Side = asrBottom Cursor = crHandPoint - Left = 8 + Left = 6 Height = 20 - Top = 72 + Top = 102 Width = 151 Anchors = [akLeft, akBottom] BorderSpacing.Around = 6 diff --git a/source/updatecheck.pas b/source/updatecheck.pas index 9185575e..49655949 100644 --- a/source/updatecheck.pas +++ b/source/updatecheck.pas @@ -15,24 +15,17 @@ type TfrmUpdateCheck = class(TExtForm) btnCancel: TButton; - groupBuild: TGroupBox; - btnBuild: TButton; groupRelease: TGroupBox; LinkLabelRelease: TLabel; lblStatus: TLabel; memoRelease: TMemo; - memoBuild: TMemo; - btnChangelog: TButton; popupDownloadRelease: TPopupMenu; CopydownloadURL1: TMenuItem; btnDonate: TButton; procedure FormCreate(Sender: TObject); - procedure btnBuildClick(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure LinkLabelReleaseLinkClick(Sender: TObject); procedure FormShow(Sender: TObject); - procedure btnChangelogClick(Sender: TObject); - procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure CopydownloadURL1Click(Sender: TObject); const SLinkDownloadRelease= 'download-release'; @@ -40,19 +33,13 @@ type SLinkChangelog = 'changelog'; private { Private declarations } - BuildURL: String; - FRestartTaskName: String; procedure Status(txt: String); function GetLinkUrl(Sender: TObject; LinkType: String): String; - function GetTaskXmlFileContents: String; public { Public declarations } - BuildRevision: Integer; procedure ReadCheckFile; end; -procedure DeleteRestartTask; - implementation @@ -76,14 +63,6 @@ begin HasSizeGrip := True; Width := AppSettings.ReadInt(asUpdateCheckWindowWidth); Height := AppSettings.ReadInt(asUpdateCheckWindowHeight); - FRestartTaskName := 'yet_invalid'; -end; - -procedure TfrmUpdateCheck.FormClose(Sender: TObject; var Action: TCloseAction); -begin - if ModalResult <> btnBuild.ModalResult then begin - DeleteRestartTask; - end; end; {** @@ -110,10 +89,10 @@ begin // which makes it impossible to compare the revisions. if Mainform.AppVerRevision = 0 then Status(_('Error: Cannot determine current revision. Using a developer version?')) - else if Mainform.AppVerRevision = BuildRevision then - Status(f_('Your %s is up-to-date (no update available).', [APPNAME])) - else if groupRelease.Enabled or btnBuild.Enabled then - Status(_('Updates available.')); + else if groupRelease.Enabled then + Status(_('Updates available.')) + else + Status(f_('Your %s is up-to-date (no update available).', [APPNAME])); except // Do not popup errors, just display them in the status label on E:Exception do @@ -138,13 +117,10 @@ var Compiled: TDateTime; const INISECT_RELEASE = 'Release'; - INISECT_BUILD = 'Build'; begin // Init GUI controls LinkLabelRelease.Enabled := False; - btnBuild.Enabled := False; memoRelease.Clear; - memoBuild.Clear; // Prepare download CheckfileDownload := THttpDownload.Create(Self); @@ -186,36 +162,6 @@ begin memoRelease.Font.Color := GetThemeColor(clWindowText); end; - // Read [Build] section of check file - if Ini.SectionExists(INISECT_BUILD) then begin - BuildRevision := Ini.ReadInteger(INISECT_BUILD, 'Revision', 0); - BuildURL := Ini.ReadString(INISECT_BUILD, 'URL', ''); - memoBuild.Lines.Add(f_('Revision %d (yours: %d)', [BuildRevision, Mainform.AppVerRevision])); - FileAge(ParamStr(0), Compiled); - memoBuild.Lines.Add(f_('Compiled: %s (yours: %s)', [Ini.ReadString(INISECT_BUILD, 'Date', ''), DateToStr(Compiled)])); - Note := Ini.ReadString(INISECT_BUILD, 'Note', ''); - if Note <> '' then - memoBuild.Lines.Add(_('Notes') + ': * ' + StringReplace(Note, '%||%', CRLF+'* ', [rfReplaceAll] ) ); - if GetExecutableBits = 64 then begin - btnBuild.Caption := f_('Download and install build %d', [BuildRevision]); - // A new release should have priority over a new nightly build. - // So the user should not be able to download a newer build here - // before having installed the new release. - //btnBuild.Enabled := (Mainform.AppVerRevision = 0) or ((BuildRevision > Mainform.AppVerRevision) and (not LinkLabelRelease.Enabled)); - end - else begin - btnBuild.Caption := _('No build updates for 32 bit version'); - end; - - if btnBuild.Enabled then begin - TaskXmlFile := GetTempDir + APPNAME + '_task_restart.xml'; - SaveUnicodeFile(TaskXmlFile, GetTaskXmlFileContents, UTF8NoBOMEncoding); - FRestartTaskName := ValidFilename(ParamStr(0)); - ShellExec('schtasks', '', '/Create /TN "'+FRestartTaskName+'" /xml '+TaskXmlFile, True); - end; - - end; - if FileExists(CheckFilename) then DeleteFile(CheckFilename); FreeAndNil(CheckfileDownload); @@ -231,22 +177,11 @@ begin end; -procedure TfrmUpdateCheck.btnChangelogClick(Sender: TObject); -begin - ShellExec(GetLinkUrl(Sender, SLinkChangelog)); -end; - - procedure TfrmUpdateCheck.CopydownloadURL1Click(Sender: TObject); begin Clipboard.TryAsText := GetLinkUrl(LinkLabelRelease, SLinkDownloadRelease); end; -procedure TfrmUpdateCheck.btnBuildClick(Sender: TObject); -begin - // No auto-update -end; - procedure TfrmUpdateCheck.FormDestroy(Sender: TObject); begin AppSettings.WriteInt(asUpdateCheckWindowWidth, ScaleFormToDesign(Width)); @@ -283,62 +218,4 @@ begin end; -function TfrmUpdateCheck.GetTaskXmlFileContents: String; -begin - Result := '' + sLineBreak + - '' + sLineBreak + - ' ' + sLineBreak + - ' 2022-12-24T12:39:17.5068755' + sLineBreak + - ' ' + APPNAME + ' ' + MainForm.AppVersion + '' + sLineBreak + - ' \' + APPNAME + '_restart' + sLineBreak + - ' ' + sLineBreak + - ' ' + sLineBreak + - ' ' + sLineBreak + - ' 2022-12-24T12:42:36' + sLineBreak + - ' true' + sLineBreak + - ' ' + sLineBreak + - ' ' + sLineBreak + - ' ' + sLineBreak + - ' ' + sLineBreak + - // Note: no with the current users SID - ' InteractiveToken' + sLineBreak + - ' LeastPrivilege' + sLineBreak + - ' ' + sLineBreak + - ' ' + sLineBreak + - ' ' + sLineBreak + - ' IgnoreNew' + sLineBreak + - ' true' + sLineBreak + - ' true' + sLineBreak + - ' true' + sLineBreak + - ' false' + sLineBreak + - ' false' + sLineBreak + - ' ' + sLineBreak + - ' true' + sLineBreak + - ' false' + sLineBreak + - ' ' + sLineBreak + - ' true' + sLineBreak + - ' true' + sLineBreak + - ' false' + sLineBreak + - ' false' + sLineBreak + - ' false' + sLineBreak + - ' PT72H' + sLineBreak + - ' 7' + sLineBreak + - ' ' + sLineBreak + - ' ' + sLineBreak + - ' ' + sLineBreak + - ' "' + ParamStr(0) + '"' + sLineBreak + - ' --runfrom=scheduler' + sLineBreak + - ' ' + sLineBreak + - ' ' + sLineBreak + - ''; -end; - - -procedure DeleteRestartTask; -begin - // TN = Task Name - // F = Force, suppress prompt - ShellExec('schtasks', '', '/Delete /TN "'+ValidFilename(ParamStr(0))+'" /F', True); -end; - end.