@@ -33,18 +33,19 @@ interface
3333 TConfigPaths = class
3434 private
3535 FSuitePathCurrentTheme: String;
36- FSuitePathList : String;
37- FSuiteDrive : String;
38- FSuitePathData : String;
39- FSuitePathSettings : String;
40- FSuitePathWorking : String;
36+ FSuitePathASuiteFolder : String;
37+ FSuitePathList : String;
38+ FSuiteDrive : String;
39+ FSuitePathData : String;
40+ FSuitePathSettings : String;
4141
4242 FEnvironmentVars : TPathList;
4343 FASuiteVars : TPathList;
4444
4545 function DeQuotedStr (AVar: AnsiString): AnsiString;
4646 function GetSuitePathBackup : String;
4747 function GetSuitePathCache : String;
48+ function GetSuitePathDocs : String;
4849 function GetSuitePathLocale : String;
4950 function GetSuitePathMenuThemes : String;
5051 procedure SetSuitePathCurrentTheme (AValue: String);
@@ -63,15 +64,16 @@ TConfigPaths = class
6364 procedure RemoveCacheFolders ;
6465 procedure UpdatePathVariables ;
6566
66- property SuitePathList: String read FSuitePathList write FSuitePathList;
67- property SuitePathSettings: String read FSuitePathSettings write FSuitePathSettings;
68- property SuiteDrive: String read FSuiteDrive write FSuiteDrive ;
69- property SuitePathData: String read FSuitePathData write FSuitePathData;
70- property SuitePathWorking : String read FSuitePathWorking write FSuitePathWorking;
67+ property SuitePathList: String read FSuitePathList write FSuitePathList; // Path to list
68+ property SuitePathSettings: String read FSuitePathSettings; // Path to settings
69+ property SuiteDrive: String read FSuiteDrive;
70+ property SuitePathData: String read FSuitePathData; // Path to folder data
71+ property SuitePathASuiteFolder : String read FSuitePathASuiteFolder; // Path to asuite.exe
7172 property SuitePathLocale: String read GetSuitePathLocale;
7273 property SuitePathCache: String read GetSuitePathCache;
7374 property SuitePathBackup: String read GetSuitePathBackup;
7475 property SuitePathMenuThemes: String read GetSuitePathMenuThemes;
76+ property SuitePathDocs: String read GetSuitePathDocs;
7577 property SuitePathCurrentTheme: String read FSuitePathCurrentTheme write SetSuitePathCurrentTheme;
7678
7779 property EnvironmentVars: TPathList read FEnvironmentVars;
@@ -164,14 +166,19 @@ function TConfigPaths.GetSuitePathCache: String;
164166 Result := AppendPathDelim(FSuitePathData + CACHE_DIR);
165167end ;
166168
169+ function TConfigPaths.GetSuitePathDocs : String;
170+ begin
171+ Result := AppendPathDelim(FSuitePathASuiteFolder + DOCS_DIR);
172+ end ;
173+
167174function TConfigPaths.GetSuitePathLocale : String;
168175begin
169- Result := AppendPathDelim(FSuitePathWorking + LOCALE_DIR);
176+ Result := AppendPathDelim(FSuitePathASuiteFolder + LOCALE_DIR);
170177end ;
171178
172179function TConfigPaths.GetSuitePathMenuThemes : String;
173180begin
174- Result := AppendPathDelim(FSuitePathWorking + MENUTHEMES_DIR);
181+ Result := AppendPathDelim(FSuitePathASuiteFolder + MENUTHEMES_DIR);
175182end ;
176183
177184procedure TConfigPaths.UpdateASuiteVars ;
@@ -183,7 +190,7 @@ procedure TConfigPaths.UpdateASuiteVars;
183190 strFolderIcon := AppendPathDelim(FSuitePathCurrentTheme + ICONS_DIR);
184191
185192 // CONST_PATH_ASuite = Launcher's path
186- FASuiteVars.Add(DeQuotedStr(CONST_PATH_ASUITE), ExcludeTrailingPathDelimiter(SuitePathWorking ));
193+ FASuiteVars.Add(DeQuotedStr(CONST_PATH_ASUITE), ExcludeTrailingPathDelimiter(FSuitePathASuiteFolder ));
187194
188195 // CONST_PATH_DRIVE = Launcher's Drive (ex. ASuite in H:\Software\ASuite.exe, CONST_PATH_DRIVE is H: )
189196 FASuiteVars.Add(DeQuotedStr(CONST_PATH_DRIVE), SUITEDRIVE);
@@ -201,7 +208,7 @@ constructor TConfigPaths.Create(APathExecutable: string);
201208begin
202209 // Default paths
203210 strPathExe := APathExecutable;
204- FSuitePathWorking := ExtractFilePath(strPathExe);
211+ FSuitePathASuiteFolder := ExtractFilePath(strPathExe);
205212
206213 strFileListSql := ExtractFileNameOnly(strPathExe) + EXT_SQL;
207214 strFileListXml := ExtractFileNameOnly(strPathExe) + EXT_XML;
@@ -212,18 +219,18 @@ constructor TConfigPaths.Create(APathExecutable: string);
212219 // In Linux, use the folder path of asuite
213220 FSuiteDrive := FSuitePathWorking;
214221 { $ENDIF}
215- SetCurrentDir(FSuitePathWorking );
222+ SetCurrentDir(FSuitePathASuiteFolder );
216223
217224 // If ASuite is started from a hard linked folder, it will be falsely unwritable
218225 // The user is unlikely to create a hard link for ASuite unless they use Scoop
219226 // In this case, however, the .sqlite files will already exist and you can
220227 // safely use them
221- if (IsDirectoryWritable(FSuitePathWorking )) or FileExists(FSuitePathWorking + strFileListXml) or
222- FileExists(FSuitePathWorking + strFileListSql) then
223- FSuitePathData := FSuitePathWorking
228+ if (IsDirectoryWritable(FSuitePathASuiteFolder )) or FileExists(FSuitePathASuiteFolder + strFileListXml) or
229+ FileExists(FSuitePathASuiteFolder + strFileListSql) then
230+ FSuitePathData := FSuitePathASuiteFolder
224231 else begin
225- // FSuitePathWorking = ASuite.exe folder (ex C:\path\to\asuite_folder\)
226- // FSuitePathData = ASuite config folder (ex. C:\Users\user\AppData\Roaming\asuite\)
232+ // FSuitePathASuiteFolder = ASuite.exe folder (ex C:\path\to\asuite_folder\)
233+ // FSuitePathData = ASuite config folder (ex. C:\Users\user\AppData\Roaming\asuite\)
227234 FSuitePathData := GetAppConfigDir(True);
228235 SysUtils.ForceDirectories(FSuitePathData);
229236 end ;
@@ -285,7 +292,7 @@ function TConfigPaths.RelativeToAbsolute(const APath: String;
285292 // Note: Unfortunately old asuite vars is not quoted, but in format $var.
286293 // So these two vars are deprecated. This code remain for only backwards compatibility
287294 // CONST_PATH_ASuite_old = Launcher's path
288- Result := StringReplace(Result, CONST_PATH_ASuite_old, ExcludeTrailingPathDelimiter(SuitePathWorking ), [rfIgnoreCase,rfReplaceAll]);
295+ Result := StringReplace(Result, CONST_PATH_ASuite_old, ExcludeTrailingPathDelimiter(FSuitePathASuiteFolder ), [rfIgnoreCase,rfReplaceAll]);
289296 // CONST_PATH_DRIVE_old = Launcher's Drive (ex. ASuite in H:\Software\ASuite.exe, CONST_PATH_DRIVE is H: )
290297 Result := StringReplace(Result, CONST_PATH_DRIVE_old, SUITEDRIVE, [rfIgnoreCase,rfReplaceAll]);
291298
0 commit comments