updates for testing in windows
This commit is contained in:
parent
30123bc023
commit
13b5474cd8
@ -48,6 +48,11 @@ var (
|
||||
|
||||
func NewAgentConfig() *rmm.AgentConfig {
|
||||
k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\TacticalRMM`, registry.ALL_ACCESS)
|
||||
if shared.TEST {
|
||||
err = nil
|
||||
k, _, err := registry.OpenKey(registry.CURRENT_USER, `SOFTWARE\TacticalRMM`, registry.ALL_ACCESS)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return &rmm.AgentConfig{}
|
||||
}
|
||||
@ -835,6 +840,11 @@ func (a *Agent) InstallService() error {
|
||||
|
||||
// skip on first call of inno setup if this is a new install
|
||||
_, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\TacticalRMM`, registry.ALL_ACCESS)
|
||||
if shared.TEST {
|
||||
err = nil
|
||||
k, _, err := registry.OpenKey(registry.CURRENT_USER, `SOFTWARE\TacticalRMM`, registry.ALL_ACCESS)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
@ -13,9 +13,7 @@ package agent
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/amidaware/rmmagent/shared"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
|
@ -24,6 +24,10 @@ import (
|
||||
|
||||
func createAgentConfig(baseurl, agentid, apiurl, token, agentpk, cert, proxy, meshdir string) {
|
||||
k, _, err := registry.CreateKey(registry.LOCAL_MACHINE, `SOFTWARE\TacticalRMM`, registry.ALL_ACCESS)
|
||||
if shared.TEST {
|
||||
err = nil
|
||||
k, _, err := registry.OpenKey(registry.CURRENT_USER, `SOFTWARE\TacticalRMM`, registry.ALL_ACCESS)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
log.Fatalln("Error creating registry key:", err)
|
||||
|
Loading…
Reference in New Issue
Block a user