X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=registry.cpp;h=3410e4af9efad2f0217a256f883652e00c8407ef;hb=c03d51cbbfe9f4f8a28dbabbfc068573a1842b74;hp=bd79dc3da435b3042e6fe269352443ff51b8bffa;hpb=54438652fac1f4f8dc6120bbfa8aac766aa656d3;p=nssm.git diff --git a/registry.cpp b/registry.cpp index bd79dc3..3410e4a 100644 --- a/registry.cpp +++ b/registry.cpp @@ -119,6 +119,8 @@ int create_parameters(nssm_service_t *service, bool editing) { else if (editing) RegDeleteValue(key, NSSM_REG_ROTATE_BYTES_LOW); if (service->rotate_bytes_high) set_number(key, NSSM_REG_ROTATE_BYTES_HIGH, service->rotate_bytes_high); else if (editing) RegDeleteValue(key, NSSM_REG_ROTATE_BYTES_HIGH); + if (service->no_console) set_number(key, NSSM_REG_NO_CONSOLE, 1); + else if (editing) RegDeleteValue(key, NSSM_REG_NO_CONSOLE); /* Environment */ if (service->env) { @@ -489,6 +491,9 @@ int get_parameters(nssm_service_t *service, STARTUPINFO *si) { if (get_number(key, NSSM_REG_ROTATE_BYTES_LOW, &service->rotate_bytes_low, false) != 1) service->rotate_bytes_low = 0; if (get_number(key, NSSM_REG_ROTATE_BYTES_HIGH, &service->rotate_bytes_high, false) != 1) service->rotate_bytes_high = 0; + /* Try to get force new console setting - may fail. */ + if (get_number(key, NSSM_REG_NO_CONSOLE, &service->no_console, false) != 1) service->no_console = 0; + /* Change to startup directory in case stdout/stderr are relative paths. */ TCHAR cwd[PATH_LENGTH]; GetCurrentDirectory(_countof(cwd), cwd);