Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cmd/newrelic-infra/initialize/initialize_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"errors"
"fmt"
"os"
"path/filepath"
"syscall"

"github.com/sirupsen/logrus"
Expand All @@ -27,9 +28,10 @@ const (
idlePriorityClass = 0x00000040
normalPriorityClass = 0x00000020
realtimePriorityClass = 0x00000100
agentTemporaryFolder = "C:\\ProgramData\\New Relic\\newrelic-infra\\tmp"
)

var agentTemporaryFolder = filepath.Join(os.Getenv("ProgramData"), "New Relic", "newrelic-infra", "tmp")

var priorityClasses = map[string]uint{
"Normal": normalPriorityClass,
"Idle": idlePriorityClass,
Expand Down
6 changes: 1 addition & 5 deletions pkg/config/config_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import (
)

const (
installationSubdir = "Program Files" + string(filepath.Separator) +
"New Relic" + string(filepath.Separator) + "newrelic-infra"
defaultAppDataSubDir = "New Relic" + string(filepath.Separator) + "newrelic-infra"
defaultConnectEnabled = true
)
Expand Down Expand Up @@ -51,9 +49,7 @@ func init() {
programData := os.Getenv("ProgramData")
defaultAppDataDir = filepath.Join(programData, defaultAppDataSubDir)

sysDrive := os.Getenv("SystemDrive") + string(filepath.Separator)

defaultAgentDir = filepath.Join(sysDrive, installationSubdir)
defaultAgentDir = filepath.Join(os.Getenv("ProgramFiles"), "New Relic", "newrelic-infra")
defaultSafeBinDir = defaultAgentDir
defaultConfigDir = defaultAgentDir
defaultLogFile = filepath.Join(defaultAgentDir, "newrelic-infra.log")
Expand Down