windows binary with subsystem window

pull/432/head
Darien Raymond 8 years ago
parent 21b6fa5217
commit 41a9aec10e
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -76,16 +76,29 @@ func build(targetOS, targetArch string, archive bool, version string, metadataFi
targetFile := getTargetFile(v2rayOS) targetFile := getTargetFile(v2rayOS)
targetFileFull := filepath.Join(targetDir, targetFile) targetFileFull := filepath.Join(targetDir, targetFile)
err = buildV2Ray(targetFileFull, version, v2rayOS, v2rayArch) err = buildV2Ray(targetFileFull, version, v2rayOS, v2rayArch, "")
if err != nil { if err != nil {
fmt.Println("Unable to build V2Ray: " + err.Error()) fmt.Println("Unable to build V2Ray: " + err.Error())
} }
if v2rayOS == Windows {
err = buildV2Ray(filepath.Join(targetDir, "w"+targetFile), version, v2rayOS, v2rayArch, "-H windowsgui")
if err != nil {
fmt.Println("Unable to build V2Ray no console: " + err.Error())
}
}
if *flagSignBinary { if *flagSignBinary {
err := signFile(targetFileFull) err := signFile(targetFileFull)
if err != nil { if err != nil {
fmt.Println("Unable to sign V2Ray binary: " + err.Error()) fmt.Println("Unable to sign V2Ray binary: " + err.Error())
} }
if v2rayOS == Windows {
err = signFile(filepath.Join(targetDir, "w"+targetFile))
if err != nil {
fmt.Println("Unable to sign V2Ray no console: " + err.Error())
}
}
} }
err = copyConfigFiles(targetDir, v2rayOS) err = copyConfigFiles(targetDir, v2rayOS)

@ -7,9 +7,9 @@ import (
"time" "time"
) )
func buildV2Ray(targetFile string, version string, goOS GoOS, goArch GoArch) error { func buildV2Ray(targetFile string, version string, goOS GoOS, goArch GoArch, extraLdFlags string) error {
goPath := os.Getenv("GOPATH") goPath := os.Getenv("GOPATH")
ldFlags := "-s" ldFlags := "-s " + extraLdFlags
if version != "custom" { if version != "custom" {
year, month, day := time.Now().UTC().Date() year, month, day := time.Now().UTC().Date()
today := fmt.Sprintf("%04d%02d%02d", year, int(month), day) today := fmt.Sprintf("%04d%02d%02d", year, int(month), day)

Loading…
Cancel
Save