Skip to content

Commit

Permalink
add windows metadata to executable
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinschaul committed Sep 4, 2024
1 parent 73d6737 commit f9c75a9
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@ public

# IDE
.vscode/
.idea/
.idea/

# Window metadata files
/desktop/winres/winres.json
/desktop/*.syso
9 changes: 8 additions & 1 deletion desktop/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ GOBIN := $(if $(GOBIN),$(GOBIN),$(HOME)/go/bin)

all: $(BINARY)

$(BINARY): $(GOBIN)/gox $(SOURCES) version.go rice-box.go
$(BINARY): $(GOBIN)/gox $(GOBIN)/go-winres $(SOURCES) version.go rice-box.go winres/winres.json
$(GOBIN)/go-winres make --product-version=$(VERSION)
$(GOBIN)/gox -osarch "windows/amd64 linux/amd64 darwin/amd64" -output "bin/{{.OS}}/${BINARY}"

winres/winres.json: winres/winres_template.json
sed 's/{{.Version}}/$(VERSION)/g' winres/winres_template.json > $@

$(GOBIN)/go-winres:
go install github.com/tc-hib/go-winres@latest

# Copy the current release into ./editor/maputnik so it can be
# embedded in the binary
editor/pull_release:
Expand Down
53 changes: 53 additions & 0 deletions desktop/winres/winres_template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"RT_MANIFEST": {
"#1": {
"0409": {
"identity": {
"name": "Maputnik",
"version": "{{.Version}}"
},
"description": "A MapLibre GL visual style editor",
"minimum-os": "win7",
"execution-level": "as invoker",
"ui-access": false,
"auto-elevate": false,
"dpi-awareness": "system",
"disable-theming": false,
"disable-window-filtering": false,
"high-resolution-scrolling-aware": false,
"ultra-high-resolution-scrolling-aware": false,
"long-path-aware": false,
"printer-driver-isolation": false,
"gdi-scaling": false,
"segment-heap": false,
"use-common-controls-v6": false
}
}
},
"RT_VERSION": {
"#1": {
"0000": {
"fixed": {
"file_version": "{{.Version}}",
"product_version": "{{.Version}}"
},
"info": {
"0409": {
"Comments": "https://github.com/maplibre/maputnik",
"CompanyName": "Maputnik",
"FileDescription": "A MapLibre GL visual style editor",
"FileVersion": "{{.Version}}",
"InternalName": "Maputnik",
"LegalCopyright": "MIT License",
"LegalTrademarks": "",
"OriginalFilename": "Maputnik.exe",
"PrivateBuild": "",
"ProductName": "Maputnik",
"ProductVersion": "{{.Version}}",
"SpecialBuild": ""
}
}
}
}
}
}

0 comments on commit f9c75a9

Please sign in to comment.