Try to create messages at install time.
authorIain Patterson <me@iain.cx>
Fri, 17 Jun 2016 14:38:00 +0000 (15:38 +0100)
committerIain Patterson <me@iain.cx>
Tue, 5 Jul 2016 07:15:27 +0000 (08:15 +0100)
If the service was never run under a privileged account we might not
have been able to set the message source in the registry.

Set the message source when installing the service, as we are guaranteed
to have the necessary rights.

nssm.cpp

index ff9eb52..647ea40 100644 (file)
--- a/nssm.cpp
+++ b/nssm.cpp
@@ -146,6 +146,7 @@ int _tmain(int argc, TCHAR **argv) {
     if (str_equiv(argv[1], _T("rotate"))) exit(control_service(NSSM_SERVICE_CONTROL_ROTATE, argc - 2, argv + 2));\r
     if (str_equiv(argv[1], _T("install"))) {\r
       if (! is_admin) exit(elevate(argc, argv, NSSM_MESSAGE_NOT_ADMINISTRATOR_CANNOT_INSTALL));\r
+      create_messages();\r
       exit(pre_install_service(argc - 2, argv + 2));\r
     }\r
     if (str_equiv(argv[1], _T("edit")) || str_equiv(argv[1], _T("get")) || str_equiv(argv[1], _T("set")) || str_equiv(argv[1], _T("reset")) || str_equiv(argv[1], _T("unset"))) {\r