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