salvadordf / WebView4Delphi

WebView4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC for Windows.
https://www.briskbard.com/forum/
MIT License
280 stars 56 forks source link

WebView2Loader: Make DLL path configurable + add native implementation #24

Closed hhonisch closed 2 years ago

hhonisch commented 2 years ago

We have an application that we distribute as a single EXE - and we'd like to avoid distributing an extra WebView2Loader.dll file. There are two options that we're considering, for which I have implemented the necessary enhancements here:

a) Include WebView2Loader.dll as a binary resource inside the application EXE, and extract it to TEMP dir (which is always writable) on application startup, so the WebView4Delphi code can load the DLL from there => added option to specify a path from where to load WebView2Loader.dll => set via TWVLoader.LoaderDllPath := 'C:\Temp\WebViewLoader2.dll'

b) Use a Delphi-native re-implementation of the WebView2Loader logic, so no Loader.dll is required at all => added unit uWVLoaderInternal.pas that contains the required native code => activated via TWVLoader.UseInternalLoader := true

salvadordf commented 2 years ago

I merged the new properties and the new unit manually. Thanks for all these pull requests! :D