diff --git a/winres/gen/json.go b/winres/gen/json.go new file mode 100644 index 00000000..e2f1a523 --- /dev/null +++ b/winres/gen/json.go @@ -0,0 +1,87 @@ +// Package main generates winres.json +package main + +import ( + "fmt" + "os" + "time" + + "github.com/FloatTech/ZeroBot-Plugin/kanban/banner" +) + +const js = `{ + "RT_GROUP_ICON": { + "APP": { + "0000": [ + "icon.png", + "icon16.png" + ] + } + }, + "RT_MANIFEST": { + "#1": { + "0409": { + "identity": { + "name": "", + "version": "" + }, + "description": "", + "minimum-os": "vista", + "execution-level": "as invoker", + "ui-access": false, + "auto-elevate": false, + "dpi-awareness": "system", + "disable-theming": false, + "disable-window-filtering": false, + "high-resolution-scrolling-aware": false, + "ultra-high-resolution-scrolling-aware": false, + "long-path-aware": false, + "printer-driver-isolation": false, + "gdi-scaling": false, + "segment-heap": false, + "use-common-controls-v6": false + } + } + }, + "RT_VERSION": { + "#1": { + "0000": { + "fixed": { + "file_version": "%s", + "product_version": "%s", + "timestamp": "%s" + }, + "info": { + "0409": { + "Comments": "OneBot plugins based on ZeroBot", + "CompanyName": "FloatTech", + "FileDescription": "Project: https://github.com/FloatTech/ZeroBot-Plugin", + "FileVersion": "%s", + "InternalName": "", + "LegalCopyright": "%s", + "LegalTrademarks": "", + "OriginalFilename": "ZBP.EXE", + "PrivateBuild": "", + "ProductName": "", + "ProductVersion": "%s", + "SpecialBuild": "" + } + } + } + } + } +}` + +const timeformat = `2006-01-02T15:04:05+08:00` + +func main() { + f, err := os.Create("winres.json") + if err != nil { + panic(err) + } + defer f.Close() + _, err = fmt.Fprintf(f, js, banner.Version, banner.Version, time.Now().Format(timeformat), banner.Version, banner.Copyright, banner.Version) + if err != nil { + panic(err) + } +} diff --git a/winres/icon.png b/winres/icon.png new file mode 100644 index 00000000..945b1cf1 Binary files /dev/null and b/winres/icon.png differ diff --git a/winres/icon16.png b/winres/icon16.png new file mode 100644 index 00000000..7c391980 Binary files /dev/null and b/winres/icon16.png differ diff --git a/winres/init.go b/winres/init.go new file mode 100644 index 00000000..3c7fb2e1 --- /dev/null +++ b/winres/init.go @@ -0,0 +1,4 @@ +// Package winres 生成windows资源 +package winres + +//go:generate go run github.com/FloatTech/ZeroBot-Plugin/winres/gen diff --git a/winres/winres.json b/winres/winres.json new file mode 100644 index 00000000..23a81fc6 --- /dev/null +++ b/winres/winres.json @@ -0,0 +1,62 @@ +{ + "RT_GROUP_ICON": { + "APP": { + "0000": [ + "icon.png", + "icon16.png" + ] + } + }, + "RT_MANIFEST": { + "#1": { + "0409": { + "identity": { + "name": "", + "version": "" + }, + "description": "", + "minimum-os": "vista", + "execution-level": "as invoker", + "ui-access": false, + "auto-elevate": false, + "dpi-awareness": "system", + "disable-theming": false, + "disable-window-filtering": false, + "high-resolution-scrolling-aware": false, + "ultra-high-resolution-scrolling-aware": false, + "long-path-aware": false, + "printer-driver-isolation": false, + "gdi-scaling": false, + "segment-heap": false, + "use-common-controls-v6": false + } + } + }, + "RT_VERSION": { + "#1": { + "0000": { + "fixed": { + "file_version": "v1.6.2", + "product_version": "v1.6.2", + "timestamp": "2023-03-01T12:44:11+08:00" + }, + "info": { + "0409": { + "Comments": "OneBot plugins based on ZeroBot", + "CompanyName": "FloatTech", + "FileDescription": "Project: https://github.com/FloatTech/ZeroBot-Plugin", + "FileVersion": "v1.6.2", + "InternalName": "", + "LegalCopyright": "© 2020 - 2023 FloatTech", + "LegalTrademarks": "", + "OriginalFilename": "ZBP.EXE", + "PrivateBuild": "", + "ProductName": "", + "ProductVersion": "v1.6.2", + "SpecialBuild": "" + } + } + } + } + } +} \ No newline at end of file