[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
This commit is contained in:
stffabi
2022-03-02 19:44:31 +11:00
committed by GitHub
parent c63b1f1981
commit b02dbfaddf
27 changed files with 781 additions and 166 deletions
+3
View File
@@ -46,6 +46,9 @@ func (a *Apt) Packages() packagemap {
"docker": []*Package{
{Name: "docker.io", SystemPackage: true, Optional: true},
},
"nsis": []*Package{
{Name: "nsis", SystemPackage: true, Optional: true},
},
}
}
+25 -2
View File
@@ -1,10 +1,11 @@
package system
import (
"github.com/wailsapp/wails/v2/internal/system/operatingsystem"
"github.com/wailsapp/wails/v2/internal/system/packagemanager"
"os/exec"
"strings"
"github.com/wailsapp/wails/v2/internal/system/operatingsystem"
"github.com/wailsapp/wails/v2/internal/system/packagemanager"
)
var (
@@ -75,6 +76,28 @@ func checkUPX() *packagemanager.Dependancy {
}
}
func checkNSIS() *packagemanager.Dependancy {
// Check for nsis installer
output, err := exec.Command("makensis", "-VERSION").Output()
installed := true
version := ""
if err != nil {
installed = false
} else {
version = strings.TrimSpace(strings.Split(string(output), "\n")[0])
}
return &packagemanager.Dependancy{
Name: "nsis ",
PackageName: "N/A",
Installed: installed,
InstallCommand: "Available at https://nsis.sourceforge.io/Download",
Version: version,
Optional: true,
External: false,
}
}
func checkDocker() *packagemanager.Dependancy {
// Check for npm
+1
View File
@@ -54,5 +54,6 @@ func (i *Info) discover() error {
i.Dependencies = append(i.Dependencies, xcodeDep)
i.Dependencies = append(i.Dependencies, checkNPM())
i.Dependencies = append(i.Dependencies, checkUPX())
i.Dependencies = append(i.Dependencies, checkNSIS())
return nil
}
+7
View File
@@ -45,6 +45,13 @@ func (i *Info) discover() error {
dep.Version = locallyInstalled.Version
}
}
if dep.Name == "nsis" {
locallyInstalled := checkNSIS()
if locallyInstalled.Installed {
dep.Installed = true
dep.Version = locallyInstalled.Version
}
}
}
i.Dependencies = dependencies
}
+1
View File
@@ -21,6 +21,7 @@ func (i *Info) discover() error {
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