5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 15:30:37 +08:00
wails/v2/internal/system/system_windows.go
stffabi b02dbfaddf
[v2] NSIS installer support for Windows (#1184)
* [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
2022-03-02 19:44:31 +11:00

46 lines
1.1 KiB
Go

//go:build windows
// +build windows
package system
import (
"github.com/leaanthony/go-webview2/webviewloader"
"github.com/wailsapp/wails/v2/internal/system/operatingsystem"
"github.com/wailsapp/wails/v2/internal/system/packagemanager"
)
func (i *Info) discover() error {
var err error
osinfo, err := operatingsystem.Info()
if err != nil {
return err
}
i.OS = osinfo
i.Dependencies = append(i.Dependencies, checkWebView2())
i.Dependencies = append(i.Dependencies, checkNPM())
i.Dependencies = append(i.Dependencies, checkUPX())
i.Dependencies = append(i.Dependencies, checkNSIS())
//i.Dependencies = append(i.Dependencies, checkDocker())
return nil
}
func checkWebView2() *packagemanager.Dependancy {
version, _ := webviewloader.GetInstalledVersion()
installed := version != ""
return &packagemanager.Dependancy{
Name: "WebView2 ",
PackageName: "N/A",
Installed: installed,
InstallCommand: "Available at https://developer.microsoft.com/en-us/microsoft-edge/webview2/",
Version: version,
Optional: false,
External: true,
}
}