我一直在使用 TEdgeBrowser/WebView2 和 Edge Beta/Canary 瀏覽器版本的安裝版本作為“運行時”,這似乎作業正常。但是,對于生產部署,我們更愿意從我們的應用程式目錄中發布運行時的固定版本。
我一直在嘗試使用以下內容:
MyEdgeBrowser.BrowserExecutableFolder := ExtractFileDir(Application.ExeName) '\WebView2Runtime';
在上面參考的路徑中,我有 msedgewebview2.exe 以及完整安裝的固定版本運行時和所有支持檔案和檔案夾。這是我下載并提取的檔案:
Microsoft.WebView2.FixedVersionRuntime.98.0.1108.62.x86.cab
這是提取后的影像:

I have attempted to place the WebView2Loader.dll in my app directory, in the WebView2Runtime folder, and even in the WebView2Runtime\win-x86\native folder, always as a subfolder of my application directory.
I've tried the 11/20/2021 version of WebView2Loader.dll that Embarcadero distributes with the GetIt package manager, as well as the latest and greatest versions distributed by Microsoft via the NuGet package manager.
The CreateWebView call always fails.
Has anyone successfully got the fixed version runtime to work with Delphi & the WebView2Loader.dll? Are there version specific issues? What folder structure is required?
Thanks.
UPDATE: One crappy workaround that I found was to install a dev or canary version of Edge, then copy all of the files from the "C:\Program Files(x86)\Microsoft\Edge Beta" folder into my app folder, uninstall Edge Beta/Canary, then point the BrowserExecutableFolder to the "Edge Beta\Application<version #>" folder. This is the first time I've seen a "fixed version runtime" function without an Edge or Canary install.
uj5u.com熱心網友回復:
我在 64 位模式下啟動了該專案,但由于內部原因不得不切換到 32 位模式。不幸的是,我沒有切換回 WebView2Loader.dll 的 32 位版本,而是使用了 32 位版本的運行時。
一旦我切換到 WebView2Loader.dll 的 32 位版本,TEdgeBrowser 就能夠使用固定版本的運行時,無需進一步安裝。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/450617.html
