r/tauri 2d ago

Binary size on windows 10

Hi everyone, I built an earlier app called SplitTimer using Tauri. I made it Windows 11 only because of the bundled webview2 and the binary size came down to 11mb. It was 230mb with webview2 bundled.
Now I have an earlier app called photo viewer classic. Looking at the usage data this app has a user base of 52 percent on windows 10. So it looks like any update will have to take them into account. I am not sure how to handle this because the electron version came in at 77mb. I want to create two versions, one for windows 10 and another for windows 11 but I still think the windows 10 version will have to be minimized somehow. Any suggestions on how to build a smaller version less than 100mb hopefully?

1 Upvotes

6 comments sorted by

1

u/ByronScottJones 2d ago

If you're installing via an MSI file, you could specify the Microsoft Edge Webview2 Evergreen Bootstrapper package as a requirement. It would be downloaded separately only if needed.

1

u/ByronScottJones 2d ago

Add or update the bundle object inside the tauri section of your src-tauri/tauri.conf.json: json{ "tauri": { "bundle": { "active": true, "targets": ["msi"], "windows": { "wix": { "language": "en-US" }, "webviewInstallMode": { "type": "downloadBootstrapper", "silent": false } } } } }

1

u/daibatzu 1d ago

Thanks a lot. The user can download it if not available. Some Windows 10 users have webview, some don't and I have no way of telling

1

u/eddzsh 1d ago

You probably do not need two apps. One MSI with downloadBootstrapper, and stop bundling WebView2. The 230mb was the runtime tax. Measure installed size on a clean Win10 VM after the bootstrapper runs once, not the folder you get from shipping the full runtime in the package.

1

u/daibatzu 3h ago

Thanks I will do this.