1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-01 16:13:53 +00:00

Fixed bug introduced by previous fix that imported .msh file earlier. Settings file cannot be imported when running agent installer, so modified behavior so if agent installer is going to run, the .msh is not imported.

This commit is contained in:
Bryan Roe
2021-08-02 22:45:32 -07:00
parent 573c12de39
commit b550dd7a53

View File

@@ -4552,21 +4552,23 @@ int MeshAgent_AgentMode(MeshAgentHostContainer *agentHost, int paramLen, char **
}
paramLen -= ixr;
// Check to see if we need to import a settings file
if (importSettings(agentHost, MeshAgent_MakeAbsolutePath(agentHost->exePath, ".mshx")) == 0)
if (ILibSimpleDataStore_IsCacheOnly(agentHost->masterDb) == 0)
{
if (importSettings(agentHost, MeshAgent_MakeAbsolutePath(agentHost->exePath, ".msh")) == 0)
// Check to see if we need to import a settings file
if (importSettings(agentHost, MeshAgent_MakeAbsolutePath(agentHost->exePath, ".mshx")) == 0)
{
if ((importSettings(agentHost, "mesh_linumshx") == 0) && (importSettings(agentHost, "mesh_limshx") == 0)) // Do this because the old agent would generate this bad file name on linux.
if (importSettings(agentHost, MeshAgent_MakeAbsolutePath(agentHost->exePath, ".msh")) == 0)
{
// Let's check to see if an .msh was embedded into our binary
checkForEmbeddedMSH(agentHost);
importSettings(agentHost, MeshAgent_MakeAbsolutePath(agentHost->exePath, ".msh"));
if ((importSettings(agentHost, "mesh_linumshx") == 0) && (importSettings(agentHost, "mesh_limshx") == 0)) // Do this because the old agent would generate this bad file name on linux.
{
// Let's check to see if an .msh was embedded into our binary
checkForEmbeddedMSH(agentHost);
importSettings(agentHost, MeshAgent_MakeAbsolutePath(agentHost->exePath, ".msh"));
}
}
}
}
#ifdef WIN32
if (agentHost->noCertStore == 0) { agentHost->noCertStore = ILibSimpleDataStore_Get(agentHost->masterDb, "nocertstore", NULL, 0); }
#endif