@@ -161,13 +161,15 @@ procedure TMain.FormCreate(Sender: TObject);
161161
162162 FulllPath:=ExtractFilePath(ParamStr(0 ));
163163 Ini:=TIniFile.Create(FulllPath + ' Config.ini' );
164- LocalFile:=Ini.ReadString(' Main' , ' File' , ' ' );
164+ LocalFile:=Trim(Ini.ReadString(' Main' , ' File' , ' ' ));
165+
166+ // If the path is relative, then add the full path
167+ if (LocalFile <> ' ' ) and (Length(LocalFile) > 1 ) and (LocalFile[2 ] <> ' :' ) then
168+ LocalFile:=FulllPath + LocalFile;
165169
166- LocalFile:=StringReplace(LocalFile, ' %FULLPATH%/' , FulllPath, []);
167- LocalFile:=StringReplace(LocalFile, ' \' , ' /' , [rfReplaceAll]);
168170 EdgeUserAgent:=Ini.ReadString(' Main' , ' UserAgent' , ' ' );
169171 OpenExternalLinks:=Ini.ReadBool(' Main' , ' OpenExternalLinks' , false);
170- UserScriptPath:=StringReplace( Ini.ReadString(' Main' , ' UserScript' , ' ' ), ' %FULLPATH%/ ' , FulllPath, [] );
172+ UserScriptPath:=Ini.ReadString(' Main' , ' UserScript' , ' ' );
171173 UserScriptFile:=TStringList.Create;
172174 if FileExists(UserScriptPath) then
173175 UserScriptFile.LoadFromFile(UserScriptPath, TEncoding.UTF8);
0 commit comments