golang打包windows可执行程序

golang下给windows的可执行文件进行打包

IDI_ICON1 ICON "main.ico"
1 24 "main.exe.manifest"

1 VERSIONINFO
FILEVERSION     1,0,0,0
PRODUCTVERSION  1,0,0,0
FILEFLAGS       0x0L
FILEFLAGSMASK   0x3fL
FILESUBTYPE     0
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904B0"
        BEGIN
            VALUE "FileDescription", "阿弥陀佛"
            VALUE "FileVersion", "1.0"
            VALUE "LegalCopyright", "Mark"
            VALUE "InternalName", "去试试吧"
            VALUE "OriginalFilename", "amituofo"
            VALUE "ProductName", "念经吧"
            VALUE "ProductVersion", "1.0"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
            VALUE "Translation", 0x0409, 0x04B0
    END
END
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    version="1.0.0.0"
    processorArchitecture="x86"
    name="controls"
    type="win32"
/>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="*"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>
windres -o main-res.syso main.rc && go build -i

就会生成一个以该文件夹名为命名的exe文件,带有对应的icon和编辑的属性信息

| 访问量:
Table of Contents