-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsyso.go
49 lines (46 loc) · 1.26 KB
/
syso.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package go_chrome_build
import (
"github.com/akavel/rsrc/rsrc"
"os"
)
var manifestContent string = `
<?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"
></assemblyIdentity>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
></assemblyIdentity>
</dependentAssembly>
</dependency>
</assembly>`
func BuildSysO() error {
runPath := GetWorkingDirPath()
err := FilePutContent(runPath+"/main.manifest", manifestContent)
defer os.Remove(runPath + "/main.manifest")
if err != nil {
return err
}
var fnamein, fnameico, fnameout, arch string
// rsrc -manifest main.manifest -ico resources/icons/icon.ico -o main.syso
fnamein = "main.manifest"
fnameico = "resources/icons/icon.ico"
fnameout = "main.syso"
arch = "amd64"
if fnameout == "" {
fnameout = "rsrc_windows_" + arch + ".syso"
}
err = rsrc.Embed(fnameout, arch, fnamein, fnameico)
return err
}