Closed M0nsieurT closed 3 months ago
Hi @M0nsieurT, thanks for raising this issue! I'm glad that you were able to get DelphiLint working, and I hope you're finding it useful.
I'm not sure why this error would be happening. Could you confirm that LOCALAPPDATA is present and correct in the Delphi IDE settings (Tools > Options > IDE > Environment Variables > System Variables
)?
I know TPath.GetHomePath is not refering to %LOCALAPPDATA% but to %APPDATA%, but this change worked for me.
Maybe you can add a conditional for versions 11.0 and 11.1 to setup the path.
If the default behaviour can be problematic, I'm happy to add code to set the UserDataFolder
on all versions. Since we own %APPDATA%\DelphiLint
, a user data folder like %APPDATA%\DelphiLint\bds.exe.WebView2
could be appropriate - could you confirm whether using this line works for you?
RuleBrowser.UserDataFolder := '%APPDATA%\DelphiLint\bds.exe.WebView2';
I'm not sure why this error would be happening. Could you confirm that LOCALAPPDATA is present and correct in the Delphi IDE settings (
Tools > Options > IDE > Environment Variables > System Variables
)?
If the default behaviour can be problematic, I'm happy to add code to set the
UserDataFolder
on all versions. Since we own%APPDATA%\DelphiLint
, a user data folder like%APPDATA%\DelphiLint\bds.exe.WebView2
could be appropriate - could you confirm whether using this line works for you?
%APPDATA% did not work, it seems this value does not handle environment variables in previous versions, but it worked using the one below (I slighty changed it to make it more readable)
RuleBrowser.UserDataFolder := TPath.Combine(TPath.GetHomePath, 'DelphiLint\bds.exe.WebView2');
And below is the %APPDATA%\DelphiLint folder's content :
Thanks for investigating - as you say, seems like 11.0 doesn't handle environment variables here.
Glad to hear that this solution works, I'll get this into master soon.
Prerequisites
Delphi IDE version
Delphi 11.0 Version 28.0.42600.6491 (Professional)
DelphiLint version
1.0.2
SonarDelphi version
1.4.0
SonarQube version
9.9
Issue description
Hi, First thanks for your work ! I bought a Professional licence in 2021 and I did not renew my subscruption, so unfortunately I am locked with Delphi 11.0.
I was able to install DelphiLint but I got the issue below every time I tried to open DelphiLint analyse form :
So I had to add the line before RuleBrowser.CreateWebView into TLintToolFrame.Create to make it work :
RuleBrowser.UserDataFolder := IncludeTrailingPathDelimiter(TPath.GetHomePath()) + 'bds.exe.WebView2';
I know TPath.GetHomePath is not refering to %LOCALAPPDATA% but to %APPDATA%, but this change worked for me.
Maybe you can add a conditional for versions 11.0 and 11.1 to setup the path.
Steps to reproduce
Open Analyze File form in Delphi 11.0
Minimal Delphi code exhibiting the issue
No response