mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 20:39:34 +08:00
Merge pull request #988 from stffabi/feature/windows-versioninfo
[v2] Windows: Add file information for windows
This commit is contained in:
commit
ec1a535acb
15
v2/pkg/buildassets/build/windows/info.tmpl.json
Normal file
15
v2/pkg/buildassets/build/windows/info.tmpl.json
Normal 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)"
|
||||
}
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ package build
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user