[v2] Windows: Add file information for windows

This commit is contained in:
stffabi 2021-12-01 11:26:03 +01:00
commit fb5bcdc364
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,15 @@
{
"fixed": {
"file_version": "1.0.0"
},
"info": {
"0000": {
"ProductVersion": "1.0.0",
"CompanyName": "{{.Name}}",
"FileDescription": "{{.Name}}",
"LegalCopyright": "Copyright.........",
"ProductName": "{{.Name}}",
"Comments": "Built using Wails (https://wails.app)"
}
}
}

View file

@ -10,6 +10,7 @@ import (
"github.com/leaanthony/winicon"
"github.com/tc-hib/winres"
"github.com/tc-hib/winres/version"
"github.com/jackmordaunt/icns"
"github.com/pkg/errors"
@ -302,6 +303,14 @@ func compileResources(options *Options) error {
}
rs.SetManifest(xmlData)
if versionInfo, _ := os.ReadFile("info.json"); len(versionInfo) != 0 {
var v version.Info
if err := v.UnmarshalJSON(versionInfo); err != nil {
return err
}
rs.SetVersionInfo(v)
}
targetFile := filepath.Join(options.ProjectData.Path, options.ProjectData.Name+"-res.syso")
fout, err := os.Create(targetFile)
if err != nil {