wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
24.68k stars 1.18k forks source link

Can I configure the webview kernel in the application at packaging time? Used to help ordinary people who can't install webview. Avoid complex operations #3577

Open catfives opened 3 months ago

catfives commented 3 months ago

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like

Can I configure the webview kernel in the application at packaging time? Used to help ordinary people who can't install webview. Avoid complex operations

Describe alternatives you've considered

No response

Additional context

No response

atterpac commented 2 months ago

Mac - preinstalled because of Safari

Windows - Can configure via what webview is used in options, would require you to write a certain version to the desired location and load it here https://wails.io/docs/reference/options#webviewbrowserpath

Linux - Only if you package as a deb or app image where you allow install steps to downloads deps

biuaxia commented 2 months ago

I also want to know the specific code implementation. Can you give a corresponding example?

atterpac commented 2 months ago

The docs show how to get a specific version of a Webview runtime for windows, you'd write that to the clients device and whatever path you set is what you set as the WebviewBrowserPath in windows options.

You will need to //go:embed the version you want into your application and do a os.WriteFile with permission 0755 to allow it to be executed

Wherever you write the file should be your WebviewBrowserPath