Documentation
¶
Overview ¶
Package webview abstracts Edge WebView 2 updates for a Wineprefix.
Index ¶
- Constants
- Variables
- func Current(pfx *wine.Prefix) string
- func Install(pfx *wine.Prefix, name string) error
- func Installed(pfx *wine.Prefix, version string) bool
- func InstallerPath(pfx *wine.Prefix, version, arch string) string
- func Uninstall(pfx *wine.Prefix, version string) error
- type Channel
- type Download
Constants ¶
const VersionPath = `HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView`
VersionPath is the registry path to open and check against the DisplayVersion key for retreiving the current installed version of Edge WebView2.
Variables ¶
var Client = &http.Client{}
Client is the http.Client used for requests. http.DefaultTransport will be used to append Microsoft's certificate.
Functions ¶
func Current ¶
Current returns the current installed WebView2 version in the given Wineprefix, by invoking the registry file. If an error occured, an empty string will be returned.
It is reccomended to store the registry from [Prefix.Registry] and perform the check manually, see VersionPath.
func Install ¶
Install runs the downloaded executable with arguments for installing WebView it onto the Wineprefix. The given executable is assumed to be the executable from a WebView download URL. InstallerPath can be used as a download path.
It is the callers responsibility to ensure no downgrades have been made - see Current.
To ensure WebView2 runs correctly within the Wineprefix, a windows version override is installed by default if the Wineprefix is not Proton, since the override is installed in Proton by default.
The override will also be checked if it isn't set, in that case, the override will not be installed.
func InstallerPath ¶
InstallerPath returns a convenient path of a WebView Runtime download URL. For a Edge download, it's version must be appended with an underscore following the Edge version.
It is the user's responsibility to ensure this exists if using [Download.Install], by fetching the [Download.URL] to the path returned here.
Types ¶
type Channel ¶
type Channel string
Channel respresents a list of known download channels for Edge WebView2.
func (Channel) Downloads ¶
Download fetches the downloads for the given WebView download channel and version. The downloads that are returned consist of Edge versions and a single Runtime.
arch should be one of "x86", "x64", "ARM64".
func (Channel) Latest ¶
Latest returns the latest version of the given WebView download channel.
arch should be one of "x86", "x64", "ARM64".
type Download ¶
type Download struct {
URL string `json:"Url"`
File string `json:"FileId"`
Size int64 `json:"SizeInBytes"`
Hashes struct {
Sha1 string `json:"Sha1"`
Sha256 string `json:"Sha256"`
} `json:"Hashes"`
Delivery struct {
CatalogID string `json:"CatalogId"`
Properties struct {
IntegrityCheckInfo struct {
PiecesHashFileURL string `json:"PiecesHashFileUrl"`
HashOfHashes string `json:"HashOfHashes"`
} `json:"IntegrityCheckInfo"`
} `json:"Properties"`
} `json:"DeliveryOptimization"`
}
Download represents a version's available download.