5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 00:09:56 +08:00
wails/v2/internal/webview2runtime/webview2installer.go
2023-11-12 12:30:49 +11:00

22 lines
592 B
Go

package webview2runtime
import (
_ "embed"
"os"
"path/filepath"
)
//go:embed MicrosoftEdgeWebview2Setup.exe
var setupexe []byte
// WriteInstallerToFile writes the installer file to the given file.
func WriteInstallerToFile(targetFile string) error {
return os.WriteFile(targetFile, setupexe, 0o755)
}
// WriteInstaller writes the installer exe file to the given directory and returns the path to it.
func WriteInstaller(targetPath string) (string, error) {
installer := filepath.Join(targetPath, `MicrosoftEdgeWebview2Setup.exe`)
return installer, WriteInstallerToFile(installer)
}