wppconnect-team / WPP4Delphi

WPP4Delphi is an open-source project with the aim of exporting functions from WhatsApp Web for Delphi, which can be used to support the creation of any interaction.
Apache License 2.0
187 stars 61 forks source link

update cache, userdata and log folders RunTime #74

Open kayaliabd opened 3 months ago

kayaliabd commented 3 months ago

I am working on multi user application and I need to change cache, userdata and log folders in run time but that is not allowed after in run time

kayaliabd commented 3 months ago

`procedure TCEFConfig.SetPathCache(const Value: String); begin

     if AnsiLowerCase(FPathCache) = AnsiLowerCase(Value) Then
       Exit;

     ForceDirectories(PWideChar(ExtractFilePath(Value)));
     if not TestaOk(FPathCache, Value) Then     Exit;
           FPathCache            := Value;

end;`

TestaOK return = False

marcelo386 commented 2 months ago

PNewValue must be equal to POldValue in this case it returns false

function TCEFConfig.TestaOk(POldValue, PNewValue: String):Boolean; var LDir : String; begin if AnsiLowerCase(POldValue) = AnsiLowerCase(PNewValue) Then Begin Result := False; Exit; End;

LDir := ExtractFilePath(PNewValue); if Self.status = asInitialized then raise Exception.Create(MSG_ConfigCEF_ExceptNotFoundPATH); if not DirectoryExists(LDir) then //raise Exception.Create(Format(MSG_ExceptPath, [LDir])); //Aurino 11/07/2022 deletefile(pwidechar(ExtractFilePath(Application.ExeName) + NomeArquivoIni)) ; Result := true; end;

kayaliabd commented 2 months ago

yea, I try to disable this line but that did not work, I could not update cash folder path!!!