winRes

package
v1.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

README

applogo.ico生成工具

2种生成方式

1.syso 需要安装 windres

func syso() error {
	syso := winRes.NewSYSO()
	//命令行运行的根目录
	//在该目录下生成xxx.syso文件
	//在该目录下resources/icon.ico文件
	syso.CMDDir = "E:\\SWT\\gopath\\src\\gitee.com\\snxamdf\\golcl" 
	//指针的icon图标名称
	syso.IconName = "icon.ico"
	//生成文件,命令行提示输入信息
	return syso.RC()
}

2.rsrc 使用exe目录下解压缩 rsrc.exe.rar ,或自行编译到 github.com/akavel/rsrc

func rsrc() error {
	rsrc := winRes.NewRSRC()
	//指定rsrc.exe根目录
	rsrc.RSRCPath = "E:\\SWT\\gopath\\src\\gitee.com\\snxamdf\\golcl\\exe\\rsrc.exe"
    //命令行运行的根目录
    //在该目录下生成xxx.syso文件
    //在该目录下resources/icon.ico文件
	rsrc.CMDDir = "E:\\SWT\\gopath\\src\\gitee.com\\snxamdf\\golcl"
	//在[CMDDir]/resources目录查找icon和manifest.xml,或自行指定目录
	//rsrc.IconPath = "icon.ico"
	//rsrc.ManifestPath = "manifestPath.xml"
	return rsrc.Gen()
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RSRC

type RSRC struct {
	CMDDir       string //命令行执行并生成文件的根目录
	AppName      string
	IconPath     string
	ManifestPath string
	RSRCPath     string // rsrc.exe 目录
	// contains filtered or unexported fields
}

RSRC => github.com/akavel/rsrc

func NewRSRC

func NewRSRC() *RSRC

默认采用 syso 生成 syso 方式生成失败,可尝试rsrc方式生成 rsrc需要生成执行文件 > github.com/akavel/rsrc

func (*RSRC) Gen

func (m *RSRC) Gen() error

type SYSO

type SYSO struct {
	FileVersion      string `json:"file_version"`
	FileRCVersion    string `json:"file_rc_version"`
	ProductVersion   string `json:"product_version"`
	ProductRCVersion string `json:"product_rc_version"`
	Manifest         string `json:"manifest"`
	MainIcon         string `json:"main_icon"`
	AppName          string `json:"app_name"`
	CompanyName      string `json:"company_name"`
	FileDescription  string `json:"file_description"`
	InternalName     string `json:"internal_name"`
	LegalCopyright   string `json:"legal_copyright"`
	OriginalFilename string `json:"original_filename"`
	ProductName      string `json:"product_name"`
	CMDDir           string //命令行执行并生成文件的根目录
	IconName         string //指定的xxxx.ico名称,为空采用AppName名称,在[CMDDir]/resources目录查找该文件
}

func NewSYSO

func NewSYSO() *SYSO

默认生成图标的方式 syso ,需要安装 windres

func (*SYSO) Gen

func (m *SYSO) Gen() error

func (*SYSO) RC

func (m *SYSO) RC() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL