A Go package for auditing installed Visual C++ Redistributable and .NET runtimes on Windows systems.
To install the package, run:
go get github.com/miroslav-matejovsky/winruntimesaudit- Go 1.25.4 or later
- Windows operating system
- For .NET runtime auditing: .NET SDK installed and available in PATH
package main
import (
"fmt"
"log"
"github.com/miroslav-matejovsky/winruntimesaudit"
)
func main() {
result, err := winruntimesaudit.DoAudit()
if err != nil {
log.Fatal(err)
}
fmt.Println("VC Redistributables:")
for _, vc := range result.VCRedistRuntimes {
status := "not installed"
if vc.Installed {
status = "installed"
}
fmt.Printf("- %s (%s): %s at %s\n", vc.Version, vc.Architecture, status, vc.Path)
}
fmt.Println("\n.NET Runtimes:")
for _, dotnet := range result.DotNetRuntimes {
fmt.Printf("- %s %s at %s\n", dotnet.Type, dotnet.Version, dotnet.Location)
}
}Performs a complete audit of both VC Redistributables and .NET runtimes.
Returns an AuditResult struct containing:
VCRedistRuntimes: Slice ofVCRedistRuntimestructsDotNetRuntimes: Slice ofDotNetRuntimestructs
Represents a Visual C++ Redistributable runtime:
Version: Version string (e.g., "14.40.33810.00")Architecture: Architecture string ("x86" or "x64")Installed: Boolean indicating installation statusPath: Registry path where the runtime is registered
Represents a .NET runtime:
Type: Runtime type (e.g., "Microsoft.AspNetCore.App", "Microsoft.NETCore.App")Version: Version stringLocation: Installation path
This project uses Mage for build automation.
- Install Mage:
go install github.com/magefile/mage@latest - Install golangci-lint: Follow instructions at https://golangci-lint.run/usage/install/
- Install gotestsum:
go install gotest.tools/gotestsum@latest
mage tidy: Clean up go.mod and go.summage fmt: Format code with gofmtmage vet: Run go vetmage lint: Run golangci-lintmage test: Run tests with gotestsummage all: Run all quality checks and tests
Contributions are welcome! Please ensure that:
- Code is formatted with
gofmt - All tests pass
- New functionality includes appropriate tests
- Code passes linting checks
This project is licensed under the MIT License.