DefaultUserDataFolderLocation
Interface AntView
Type: Property
Access: Read/Write
Data Type: TxUserDataFolderLocation
This property determines the logic that is used to create a UserDataFolder when it is not manually set by the developer.
The default is udflUserTempFolder.
When this property is set to udflUserTempFolder then the UserDataFolder is by default created in the local temp folder for the current user that runs your application.
For example:
If your user is "Tom" and the application hosting the AntView control is called "Demo.exe" then the UserDataFolder that is used and/or created is:
C:\Users\Tom\AppData\Local\Temp\Demo.exe.WebView2\
Advantages of the udflUserTempFolder are that the WebView2 data is created in a location that is maintained by the system and you don't have to worry much about cleaning up.
A disadvantage is that the data in this folder might have been deleted when the system reclaims space. So it might not be so great if you for example are depending on cookies or local storage.
Another choice is to use udflApplicationFolder
At the time of writing this is currently the Microsoft default, but this is expected to change over time.
What this does is that the control tries to create a folder for the user data in the same folder as where your application is located.
If the AntView2 control cannot create the folder then the logic will fall back to udflUserTempFolder logic.
This option means that the WebView2 control will create a sub folder with a naming scheme like "{app.exe}.WebView2\" and it is created at the folder where your executable lives. Here {app.exe} is the name of your application.
For example:
If the application hosting the Antview control is located at C:\MyAppData\Demo.exe then the UserDataFolder that is created/used is by default:
C:\MyAppData\Demo.exe.WebView2\
Advantage:
You are in full control of the persistence of the contents of the folder.
Disadvantage:
This location might have limited access for writing (for example if you install your binaries under C:\Program Files)
You are in full control, so also need to take care of cleanup if your application gets removed.
AntView - The MS Edge WebView2 ActiveX control Date last changed: 09/25/2024