Skip to content

Commit

Permalink
Merge pull request #459 from mtconnect/458_agent_install_config_issue
Browse files Browse the repository at this point in the history
  • Loading branch information
wsobel authored Jun 4, 2024
2 parents af49a4e + df6e8b2 commit b903f15
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mtconnect/configuration/service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,9 @@ namespace mtconnect {
}
RegCloseKey(mtc);

RegSetValueExA(agent, "ConfigurationFile", 0ul, REG_SZ, (const BYTE *)m_configFile.c_str(),
m_configFile.string().size() + 1);
auto cfgFile = m_configFile.string();
RegSetValueExA(agent, "ConfigurationFile", 0ul, REG_SZ, (const BYTE *)cfgFile.c_str(),
cfgFile.length() + 1);
RegCloseKey(agent);

LOG(info) << "Service installed successfully.";
Expand Down Expand Up @@ -574,9 +575,8 @@ namespace mtconnect {
boost::optional<std::string> command;
boost::optional<std::string> config;

const char *argp[3] = {"run", nullptr, nullptr};
argp[1] = (char *)configFile;
auto options = g_service->parseOptions(1, argp, command, config);
const char *argp[3] = {"agent", "run", (const char *) configFile};
auto options = g_service->parseOptions(3, argp, command, config);
g_service->initialize(options);

// Report running status when initialization is complete.
Expand Down

0 comments on commit b903f15

Please sign in to comment.