Search code examples
delphiwebview2delphi-10.1-berlin

How do I define the dataUserFolder of WebView2 Component with Delphi


I want to use WebView2 with my Delphi program. It works in the IDE (as there the runtime program is in an documents folder) but in my installed program the userDataFolder is in <exe.-Prg-name>.Webview2 as I can read here: For non-UWP apps, the default user data ({Executable File Name}.WebView2) folder is created in the same directory next to the compiled code for the app.

How can I change this userDataFolder, so it has READ/WRITE permissions. In my Program Folder under Windows 10 there are no permissions. I do not want to let the installer of my program install my program under documents, where the prg has READ/Write permissions.

I have no idea where in my Delphi Berlin Source I could define this userDataFolder.

Edit: Also the WebView component [for enable EdgeBrowser Feature also to Delphi 10.2 Berlin] from WinSOFT has in its newest version 3.3 the DataFolder Property. In Version 3.1 it was still missing. Thanks for any help. Walter


Solution

  • TEdgeBrowser has a property UserDataFolder that you can change for the purpose. This property exists in the currently latest Delphi version (Delphi 11 Alexandria). I don't know when it has been introduced.