use %APPDATA%\ewsdr on Windows instead of exe directory

Program Files is read-only for normal users; GetAppConfigDir(False)
returns the proper per-user config location on all platforms.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-02 15:52:11 +03:00
co-authored by Claude Sonnet 4.6
parent 3e1988c00e
commit 710abce288
+3 -7
View File
@@ -14,9 +14,9 @@ function QtPlatformAllowsOpenGLControls: Boolean;
function HasOpenGLSpectrumSwitch: Boolean; function HasOpenGLSpectrumSwitch: Boolean;
function CurrentScreenDPI: Integer; function CurrentScreenDPI: Integer;
// Возвращает каталог для хранения конфигурации (с завершающим разделителем). // Возвращает каталог для хранения конфигурации (с завершающим разделителем).
// macOS: ~/Library/Application Support/ewsdr/ // macOS: ~/Library/Application Support/ewsdr/
// Linux: ~/.config/ewsdr/ // Linux: ~/.config/ewsdr/
// Windows: каталог исполняемого файла // Windows: %APPDATA%\ewsdr\
function GetAppCfgDir: string; function GetAppCfgDir: string;
implementation implementation
@@ -68,13 +68,9 @@ end;
function GetAppCfgDir: string; function GetAppCfgDir: string;
begin begin
{$IFDEF WINDOWS}
Result := IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0)));
{$ELSE}
Result := IncludeTrailingPathDelimiter(GetAppConfigDir(False)); Result := IncludeTrailingPathDelimiter(GetAppConfigDir(False));
if not DirectoryExists(Result) then if not DirectoryExists(Result) then
ForceDirectories(Result); ForceDirectories(Result);
{$ENDIF}
end; end;
end. end.