5
0
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:
Lea Anthony 2021-12-01 03:09:04 -08:00 committed by GitHub
commit ec1a535acb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 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

@ -6,6 +6,7 @@ package build
import (
"fmt"
"log"
"os"
"path/filepath"
"strconv"
"strings"

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 {