From 39696237231521c3820215aeb0bd0f87eed4a085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Vivian=20Farias?= Date: Mon, 3 Nov 2025 09:38:37 -0300 Subject: [PATCH] feat: Allow installation of DelphiLint for multiple Delphi versions --- client/source/DelphiLint.IDEContext.pas | 10 ++++++++-- scripts/TEMPLATE_install.ps1 | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/client/source/DelphiLint.IDEContext.pas b/client/source/DelphiLint.IDEContext.pas index 0130b6ff..32799989 100644 --- a/client/source/DelphiLint.IDEContext.pas +++ b/client/source/DelphiLint.IDEContext.pas @@ -254,8 +254,10 @@ function BuildDelphiLintFileLogger: ILogger; LogDir: string; LogPath: string; StartDate: string; + ProductVersion: string; begin - LogDir := TPath.Combine(TPath.GetHomePath, 'DelphiLint\logs'); + ProductVersion := (BorlandIDEServices as IOTAServices).ExpandRootMacro('$(ProductVersion)'); + LogDir := TPath.Combine(TPath.GetHomePath, 'DelphiLint\' + ProductVersion + '\logs'); TDirectory.CreateDirectory(LogDir); DateTimeToString(StartDate, 'yyyy-mm-dd-hh-mm-ss', Now); LogPath := TPath.Combine(LogDir, Format('delphilint-client-%s.log', [StartDate])); @@ -265,11 +267,15 @@ function BuildDelphiLintFileLogger: ILogger; //______________________________________________________________________________________________________________________ constructor TIDELintContext.Create; +var + ProductVersion: string; begin inherited; FPlugin := TIDEPlugin.Create(GetIDEServices); - FSettingsDir := TPath.Combine(TPath.GetHomePath, 'DelphiLint'); + ProductVersion := FIDEServices.ExpandRootMacro('$(ProductVersion)'); + + FSettingsDir := TPath.Combine(TPath.GetHomePath, 'DelphiLint\' + ProductVersion); FSettings := TLintSettings.Create(TPath.Combine(FSettingsDir, 'delphilint.ini')); Log.Info('DelphiLint started at %s', [DateToISO8601(Now)]); diff --git a/scripts/TEMPLATE_install.ps1 b/scripts/TEMPLATE_install.ps1 index 7270af1b..0292e798 100644 --- a/scripts/TEMPLATE_install.ps1 +++ b/scripts/TEMPLATE_install.ps1 @@ -6,7 +6,7 @@ $ProgressPreference = "SilentlyContinue" Write-Host -ForegroundColor Red "This script is a template. Do not run it directly." Exit 1 ##{ENDREPLACE}## -$DelphiLintFolder = Join-Path $env:APPDATA "DelphiLint" +$DelphiLintFolder = Join-Path $env:APPDATA "DelphiLint\$RegistryVersion\" $BinFolder = (Join-Path $DelphiLintFolder "bin") function New-AppDataPath {