Skip to content

Commit 4f96056

Browse files
committed
fix 2
1 parent 636e424 commit 4f96056

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/build-manual.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ jobs:
188188
- name: Download and setup go-legacy-win7
189189
run: |
190190
mkdir -p /tmp/go-legacy-setup
191-
wget -P /tmp/go-legacy-setup https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.5-1/go-legacy-win7-1.25.5-1.linux_amd64.tar.gz
192-
tar -xzf /tmp/go-legacy-setup/go-legacy-win7-1.25.5-1.linux_amd64.tar.gz -C /tmp/go-legacy-setup
191+
wget -P /tmp/go-legacy-setup https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.7-1/go-legacy-win7-1.25.7-1.linux_amd64.tar.gz
192+
tar -xzf /tmp/go-legacy-setup/go-legacy-win7-1.25.7-1.linux_amd64.tar.gz -C /tmp/go-legacy-setup
193193
export GOROOT=/tmp/go-legacy-setup/go-legacy-win7
194194
export PATH=$GOROOT/bin:$PATH
195195
go version

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ gobuild-windows7() {
9898
install-wintun "$arch"
9999
archive_name="$name-windows7-$arch-$VERSION.zip"
100100
filename="$name.exe"
101-
CGO_ENABLED=0 GOOS=windows GOARCH=$arch go build -trimpath -ldflags "-s -w -H windowsgui -X github.com/anywherelan/awl/config.Version=${VERSION}" -o "$filename"
101+
CGO_ENABLED=0 GOOS=windows GOARCH=$arch go build -trimpath -ldflags "-s -w -H windowsgui -X github.com/anywherelan/awl/config.Version=${VERSION} -X github.com/anywherelan/awl/config.IsWindows7=true" -o "$filename"
102102
zip "$archive_name" "$filename"
103103
rm "$filename"
104104
mv "$archive_name" "$builddir"

config/version.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ import (
88
const DevVersion = "dev"
99

1010
var (
11+
// set via ldflags
1112
Version = DevVersion
1213
UserAgent = UserAgentPrefix + SystemInfo + "/" + Version
1314
UserAgentPrefix = "awl/"
1415
SystemInfo = runtime.GOOS + "-" + runtime.GOARCH
16+
// set via ldflags
17+
IsWindows7 = ""
1518
)
1619

1720
// IsDevVersion

update/update.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,14 @@ const (
4040
)
4141

4242
var (
43-
awlFilenamesRegex = regexp.MustCompile(fmt.Sprintf("awl-%s-%s.*", runtime.GOOS, runtime.GOARCH))
44-
awlTrayFilenamesRegex = regexp.MustCompile(fmt.Sprintf("awl-tray-%s-%s.*", runtime.GOOS, runtime.GOARCH))
43+
goos = func() string {
44+
if config.IsWindows7 == "true" {
45+
return "windows7"
46+
}
47+
return runtime.GOOS
48+
}()
49+
awlFilenamesRegex = regexp.MustCompile(fmt.Sprintf("awl-%s-%s.*", goos, runtime.GOARCH))
50+
awlTrayFilenamesRegex = regexp.MustCompile(fmt.Sprintf("awl-tray-%s-%s.*", goos, runtime.GOARCH))
4551
)
4652

4753
func NewUpdateService(c *config.Config, logger *log.ZapEventLogger, appType ApplicationType) (UpdateService, error) {

0 commit comments

Comments
 (0)