mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 06:01:52 +08:00

* [v2] Add support for post build hooks Currently only supports build-level hooks * [v2] Improve build assets handling and use single source for manifest generation The manifest asset files are now a go template and data will be resolved before they are included into the build output. Breaking Change: Windows manifest file must be named “wails.exe.manifest” and doesn’t depend on the project name anymore. * [v2, windows] NSIS installer generation
22 lines
591 B
Go
22 lines
591 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, 0755)
|
|
}
|
|
|
|
// 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)
|
|
}
|