wails icon indicating copy to clipboard operation
wails copied to clipboard

Webview2 embed option appears to be ignored in favour of download option on Windows

Open douglaswaights opened this issue 2 years ago • 2 comments

Description

Hi

I have built my wails app (on Windows 10) with the wails cmd wails build -clean -webview2 embed

I can confirm that the binary is bigger with the embed option versus the download option so it is getting respected.

Unfortunately when i take my wails app to a clean Windows Server 2022 VM on startup it prompts that it will download the webview2 runtime rather than use the embedded bootstrapper version as indicated in the docs.

Thanks in advance Doug

To Reproduce

  1. On Windows desktop wails build -clean -webview2 embed

  2. Copy to clean Windows server 2022 (in my case an Azure VM)

  3. Launch the wails app and observe it downloads the webview2 runtime rather than use the embedded version.

Expected behaviour

I expect it to use the embedded webview2 rather than downloading from the internet.

Screenshots

No response

Attempted Fixes

I ensured that i removed internet access on the Windows Server vm just in case it was "downloading the embedded" version rather than downloading from the internet but it wasn't and just hung trying to download.

System Details

# Wails
Version | v2.9.1

# System
┌──────────────────────────────────────────────────────────────────────────────────────┐
| OS           | Windows 10 Enterprise                                                 |
| Version      | 2009 (Build: 19045)                                                   |
| ID           | 22H2                                                                  |
| Go Version   | go1.22.2                                                              |
| Platform     | windows                                                               |
| Architecture | amd64                                                                 |
| CPU          | Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz                             |
| GPU 1        | Intel(R) UHD Graphics (Intel Corporation) - Driver: 31.0.101.2127     |
| GPU 2        | NVIDIA Quadro T2000 with Max-Q Design (NVIDIA) - Driver: 31.0.15.4659 |
| Memory       | 32GB                                                                  |
└──────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌───────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version       |
| WebView2   | N/A          | Installed | 126.0.2592.81 |
| Nodejs     | N/A          | Installed | 20.12.2       |
| npm        | N/A          | Installed | 8.12.1        |
| *upx       | N/A          | Available |               |
| *nsis      | N/A          | Available |               |
└─────────────── * - Optional Dependency ───────────────┘

# Diagnosis
Optional package(s) installation details:
  - upx : Available at https://upx.github.io/
  - nsis : More info at https://wails.io/docs/guides/windows-installer/

 SUCCESS  Your system is ready for Wails development!

Additional context

I also tried cross compiling for Windows in WSL2 to see if that behaved any better but i got the same result.

douglaswaights avatar Jul 02 '24 14:07 douglaswaights

The embed option embeds the webview2 bootstrapper so it can download the webview2 runtime. We don't currently embed the webview2 runtime. All windows machines for the last 2-3 years will have been receiving webview2 through windows updates so we were considering removing the bootstrap entirely. There may be a way to do offline webview2 installs but that's outside of the scope of this project.

leaanthony avatar Jul 02 '24 19:07 leaanthony

Thanks @leaanthony for clearing up my misunderstanding. I should have understood this!

I guess my use case is less common here with the app being installed on a potentially air-gapped Windows Server rather than Desktop 10 or 11. I can always ship a fixed runtime!

douglaswaights avatar Jul 03 '24 06:07 douglaswaights