Skip to content

Commit

Permalink
Add instruction for MS VC Runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyje committed Dec 11, 2022
1 parent e29a0ed commit 6dac74b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ sudo sensors-detect
### Windows

1. Install and run [ALCPU CoreTemp](https://www.alcpu.com/CoreTemp/). It is important that this application is running otherwise you will not get any data.
1. Install [MSVC Runtime 10](https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist).
1. Run the commands below.

```powershell
Expand Down
25 changes: 12 additions & 13 deletions drivers/coretempsdk/coretempsdk_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,18 @@ import (
"google.golang.org/protobuf/types/known/timestamppb"
)

var (
globalFnGetCoreTempInfo *windows.LazyProc
globalLock sync.RWMutex
)

const (
dllNameGetCoreTempInfoDLL = "GetCoreTempInfo.dll"
dllFuncfnGetCoreTempInfoAlt = "fnGetCoreTempInfoAlt"
dllURIGetCoreTempInfoDLLDownloadPage = "https://www.alcpu.com/CoreTemp/developers.html"
dllURIGetCoreTempInfoDLL = "https://www.alcpu.com/CoreTemp/main_data/CoreTempSDK.zip"
vcRuntimeDownloadPage = "https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist"

enableAutoDownload = false
)

Expand Down Expand Up @@ -65,18 +76,6 @@ type coreTempSharedDataEx struct {
fMultipliers [256]float32
}

var (
globalFnGetCoreTempInfo *windows.LazyProc
globalLock sync.RWMutex
)

const (
dllNameGetCoreTempInfoDLL = "GetCoreTempInfo.dll"
dllFuncfnGetCoreTempInfoAlt = "fnGetCoreTempInfoAlt"
dllURIGetCoreTempInfoDLLDownloadPage = "https://www.alcpu.com/CoreTemp/developers.html"
dllURIGetCoreTempInfoDLL = "https://www.alcpu.com/CoreTemp/main_data/CoreTempSDK.zip"
)

func getCoreTempInfo() (*pb.MachineMetrics, error) {
rawInfo, err := getCoreTempInfoAlt()
if err != nil {
Expand Down Expand Up @@ -156,7 +155,7 @@ func wrapDLLError(err error) error {
dir = "."
}
return coreTempSDKError{
msg: fmt.Sprintf("Make sure that '%s' is in directory '%s'. And the version is at least 1.2.0.0. You can download the DLL from '%s'. Error= %s", dllNameGetCoreTempInfoDLL, dir, dllURIGetCoreTempInfoDLLDownloadPage, err.Error()),
msg: fmt.Sprintf("Make sure that '%s' is in directory '%s'. And the version is at least 1.2.0.0. You can download the DLL from '%s'. You also need VC++ Runtime 10 from '%s'. Error= %s", dllNameGetCoreTempInfoDLL, dir, dllURIGetCoreTempInfoDLLDownloadPage, vcRuntimeDownloadPage, err.Error()),
err: err,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ extend google.protobuf.ServiceOptions {
message CommonLanguageSettings {
// Link to automatically generated reference documentation. Example:
// https://cloud.google.com/nodejs/docs/reference/asset/latest
string reference_docs_uri = 1;
string reference_docs_uri = 1 [deprecated = true];

// The destination where API teams want this client library to be published.
repeated ClientLibraryDestination destinations = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ message Expr {
message CreateList {
// The elements part of the list.
repeated Expr elements = 1;

// The indices within the elements list which are marked as optional
// elements.
//
// When an optional-typed value is present, the value it contains
// is included in the list. If the optional-typed value is absent, the list
// element is omitted from the CreateList result.
repeated int32 optional_indices = 2;
}

// A map or message creation expression.
Expand Down

0 comments on commit 6dac74b

Please sign in to comment.