dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

bundler: Webview2 installation options not respected

Open heyrict opened this issue 2 years ago • 4 comments

Problem

Webview2 offline installer was not bundled in the msi or nsis installation package even if bundle.windows.webview_install_mode was set to OfflineInstaller or FixedVersion.

Steps To Reproduce

The reproducible sample was put in https://github.com/heyrict/dioxus-bundle-sample

The build binaries from github action were only ~3MB each.

Expected behavior

The built binary should include webview2 installer (expected to be ~130MB).

Environment:

  • Dioxus version: 0.4.0
  • Rust version: nightly
  • OS info: Windows
  • App platform: desktop

Questionnaire

  • [ ] I'm interested in fixing this myself but don't know where to start
  • [ ] I would like to fix and I have a solution
  • [x] I don't have time to fix this right now, but maybe later

heyrict avatar Aug 08 '23 15:08 heyrict

I'm facing the same issue, but in addition I also tried "FixedRuntime" with a path (note: I think this topic could use some improvements in the docs, but that might be more of a topic in #87). I've tried installing the resulting msi or nsis bundle, but when starting the application afterward, it comes up with the error "Code execution cannot proceed because WebView2Loader.dll was not found. [...]"

Environment:

Dioxus version: 0.4.0 Rust version: 1.71.1 stable-x86_64-pc-windows-gnu OS info: Windows App platform: desktop

If I can be of any help in resolving this, I'm happy to do so. Any help would be greatly appreciated.

jboschuk avatar Aug 16 '23 13:08 jboschuk

I think this topic could use some improvements in the docs

Yes, we definitely need to improve the documentation around bundling

Rust version: 1.71.1 stable-x86_64-pc-windows-gnu

We have found in the past that windows-gnu tends to have more issues with tauri than windows msvc.

If I can be of any help in resolving this, I'm happy to do so. Any help would be greatly appreciated.

There are a few different things we can try here:

  1. Bumping tauri-bundle. The latest version is 2.0.0-alpha-7, but we are using an older stable version. I did find several issues in the tauri repo related to offline bundling, but none looked exactly like this.
  2. Comparing a working tauri bundle config with offline installation with a failing Dioxus.toml config. We convert our format to the tauri-bundle struct here. We could be setting some configs differently from what tauri would set.

ealmloff avatar Aug 16 '23 14:08 ealmloff

As per mentioned by @ealmloff , I've tried updating tauri-bundler to the latest and debug printing the converted tauri_bundler::BundleSettings, without any findings.

~~Correct me if I was wrong, but after a bit dig into the code base of tauri_bundler, it seems that FixedRuntime was not currently implemented even in taori itself. OfflineInstaller should work anyway. And after a brief search on github, there do exist some tauri applications that use this config to bundle their applications.~~

~~When I went through the code of tauri_bundler, I've noticed that the nsis packager will skip the webview2 section if it found that webview2 was installed. I have no knowledge on nsis and am not sure if this is related to the fact the webview installer was not bundled, but probably it is worth some testing.~~

Rectification: It seems that tauri copies some resources regarding Webview2 in tauri_build, thus running merely tauri_bundler::bundle::bundle_project was not enough.

heyrict avatar Sep 06 '23 14:09 heyrict

windows7不支持webview2...

9mlcy7 avatar Aug 09 '24 07:08 9mlcy7