diff --git a/client/source/DelphiLint.IDEContext.pas b/client/source/DelphiLint.IDEContext.pas index 0130b6f..3279998 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 7270af1..0292e79 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 {