mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-07 19:16:36 +00:00
Implement a Windows application manifest (#1445)
This commit is contained in:
9
Makefile
9
Makefile
@@ -12,10 +12,15 @@ ALL_OS:= 1809 ltsc2022
|
|||||||
BASE_IMAGE=mcr.microsoft.com/windows/nanoserver
|
BASE_IMAGE=mcr.microsoft.com/windows/nanoserver
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: windows_exporter.exe
|
build: generate windows_exporter.exe
|
||||||
|
|
||||||
windows_exporter.exe: pkg/**/*.go
|
windows_exporter.exe: pkg/**/*.go
|
||||||
promu build -v
|
promu build -v
|
||||||
|
|
||||||
|
.PHONY: generate
|
||||||
|
generate:
|
||||||
|
go generate ./...
|
||||||
|
|
||||||
test:
|
test:
|
||||||
go test -v ./...
|
go test -v ./...
|
||||||
|
|
||||||
@@ -36,7 +41,7 @@ promtool: windows_exporter.exe
|
|||||||
fmt:
|
fmt:
|
||||||
gofmt -l -w -s .
|
gofmt -l -w -s .
|
||||||
|
|
||||||
crossbuild:
|
crossbuild: generate
|
||||||
# The prometheus/golang-builder image for promu crossbuild doesn't exist
|
# The prometheus/golang-builder image for promu crossbuild doesn't exist
|
||||||
# on Windows, so for now, we'll just build twice
|
# on Windows, so for now, we'll just build twice
|
||||||
GOARCH=amd64 promu build --prefix=output/amd64
|
GOARCH=amd64 promu build --prefix=output/amd64
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
//go:build windows
|
//go:build windows
|
||||||
|
|
||||||
|
//go:generate go run github.com/tc-hib/go-winres@v0.3.3 make --product-version=git-tag --file-version=git-tag --arch=amd64,arm64
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
// Its important that we do these first so that we can register with the Windows service control ASAP to avoid timeouts
|
||||||
|
"github.com/prometheus-community/windows_exporter/pkg/initiate"
|
||||||
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -13,8 +18,6 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
// Its important that we do these first so that we can register with the windows service control ASAP to avoid timeouts
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/initiate"
|
|
||||||
winlog "github.com/prometheus-community/windows_exporter/pkg/log"
|
winlog "github.com/prometheus-community/windows_exporter/pkg/log"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/types"
|
"github.com/prometheus-community/windows_exporter/pkg/types"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/utils"
|
"github.com/prometheus-community/windows_exporter/pkg/utils"
|
||||||
|
|||||||
52
winres/winres.json
Normal file
52
winres/winres.json
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
"RT_GROUP_ICON": {
|
||||||
|
"APP": {}
|
||||||
|
},
|
||||||
|
"RT_MANIFEST": {
|
||||||
|
"#1": {
|
||||||
|
"0409": {
|
||||||
|
"description": "A Prometheus exporter for Windows machines.",
|
||||||
|
"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": "0.0.0.0",
|
||||||
|
"product_version": "0.0.0.0"
|
||||||
|
},
|
||||||
|
"info": {
|
||||||
|
"0409": {
|
||||||
|
"Comments": "",
|
||||||
|
"CompanyName": "Prometheus Community",
|
||||||
|
"FileDescription": "A Prometheus exporter for Windows machines.",
|
||||||
|
"FileVersion": "",
|
||||||
|
"InternalName": "",
|
||||||
|
"LegalCopyright": "",
|
||||||
|
"LegalTrademarks": "",
|
||||||
|
"OriginalFilename": "",
|
||||||
|
"PrivateBuild": "",
|
||||||
|
"ProductName": "",
|
||||||
|
"ProductVersion": "",
|
||||||
|
"SpecialBuild": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user