+Changes since 2.18
+-----------------
+ * The GUI is significantly less sucky.
+
Changes since 2.17
-----------------
* Timeouts for each shutdown method can be configured in
Since version 2.18, NSSM can be configured to wait a user-specified amount\r
of time for the application to exit when shutting down.\r
\r
+Since version 2.19, many more service options can be configured with the\r
+GUI installer as well as via the registry.\r
+\r
\r
Usage\r
-----\r
#include "nssm.h"\r
\r
+static enum { NSSM_TAB_APPLICATION, NSSM_TAB_SHUTDOWN, NSSM_TAB_EXIT, NSSM_TAB_IO, NSSM_NUM_TABS };\r
+static HWND tablist[NSSM_NUM_TABS];\r
+static int selected_tab;\r
+\r
static void strip_basename(char *buffer) {\r
size_t len = strlen(buffer);\r
size_t i;\r
MoveWindow(window, x, y, size.right - size.left, size.bottom - size.top, 0);\r
}\r
\r
-/* Install the service */\r
+static inline void check_stop_method(nssm_service_t *service, unsigned long method, unsigned long control) {\r
+ if (SendDlgItemMessage(tablist[NSSM_TAB_SHUTDOWN], control, BM_GETCHECK, 0, 0) & BST_CHECKED) return;\r
+ service->stop_method &= ~method;\r
+}\r
+\r
+static inline void check_method_timeout(HWND tab, unsigned long control, unsigned long *timeout) {\r
+ BOOL translated;\r
+ unsigned long configured = GetDlgItemInt(tab, control, &translated, 0);\r
+ if (translated) *timeout = configured;\r
+}\r
+\r
+static inline void check_io(char *name, char *buffer, size_t bufsize, unsigned long control) {\r
+ if (! SendMessage(GetDlgItem(tablist[NSSM_TAB_IO], control), WM_GETTEXTLENGTH, 0, 0)) return;\r
+ if (GetDlgItemText(tablist[NSSM_TAB_IO], control, buffer, (int) bufsize)) return;\r
+ popup_message(MB_OK | MB_ICONEXCLAMATION, NSSM_MESSAGE_PATH_TOO_LONG, name);\r
+ ZeroMemory(buffer, bufsize);\r
+}\r
+\r
+/* Install the service. */\r
int install(HWND window) {\r
if (! window) return 1;\r
\r
}\r
\r
/* Get executable name */\r
- if (! GetDlgItemText(window, IDC_PATH, service->exe, sizeof(service->exe))) {\r
+ if (! GetDlgItemText(tablist[NSSM_TAB_APPLICATION], IDC_PATH, service->exe, sizeof(service->exe))) {\r
popup_message(MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_PATH);\r
return 3;\r
}\r
- \r
- /* Get flags */\r
- if (SendMessage(GetDlgItem(window, IDC_FLAGS), WM_GETTEXTLENGTH, 0, 0)) {\r
+\r
+ /* Get startup directory. */\r
+ if (! GetDlgItemText(tablist[NSSM_TAB_APPLICATION], IDC_DIR, service->dir, sizeof(service->dir))) {\r
+ memmove(service->dir, service->exe, sizeof(service->dir));\r
+ strip_basename(service->dir);\r
+ }\r
+\r
+ /* Get flags. */\r
+ if (SendMessage(GetDlgItem(tablist[NSSM_TAB_APPLICATION], IDC_FLAGS), WM_GETTEXTLENGTH, 0, 0)) {\r
if (! GetDlgItemText(window, IDC_FLAGS, service->flags, sizeof(service->flags))) {\r
popup_message(MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_OPTIONS);\r
return 4;\r
}
}\r
\r
- memmove(service->dir, service->exe, strlen(service->exe));\r
- strip_basename(service->dir);\r
+ /* Get stop method stuff. */\r
+ service->stop_method = ~0;\r
+ check_stop_method(service, NSSM_STOP_METHOD_CONSOLE, IDC_METHOD_CONSOLE);\r
+ check_stop_method(service, NSSM_STOP_METHOD_WINDOW, IDC_METHOD_WINDOW);\r
+ check_stop_method(service, NSSM_STOP_METHOD_THREADS, IDC_METHOD_THREADS);\r
+ check_stop_method(service, NSSM_STOP_METHOD_TERMINATE, IDC_METHOD_TERMINATE);\r
+ check_method_timeout(tablist[NSSM_TAB_SHUTDOWN], IDC_KILL_CONSOLE, &service->kill_console_delay);\r
+ check_method_timeout(tablist[NSSM_TAB_SHUTDOWN], IDC_KILL_WINDOW, &service->kill_window_delay);\r
+ check_method_timeout(tablist[NSSM_TAB_SHUTDOWN], IDC_KILL_THREADS, &service->kill_threads_delay);\r
+\r
+ /* Get exit action stuff. */\r
+ check_method_timeout(tablist[NSSM_TAB_EXIT], IDC_THROTTLE, &service->throttle_delay);\r
+ HWND combo = GetDlgItem(tablist[NSSM_TAB_EXIT], IDC_APPEXIT);\r
+ service->default_exit_action = (unsigned long) SendMessage(combo, CB_GETCURSEL, 0, 0);\r
+ if (service->default_exit_action == CB_ERR) service->default_exit_action = 0;\r
+\r
+ /* Get I/O stuff. */\r
+ check_io("stdin", service->stdin_path, sizeof(service->stdin_path), IDC_STDIN);\r
+ check_io("stdout", service->stdout_path, sizeof(service->stdout_path), IDC_STDOUT);\r
+ check_io("stderr", service->stderr_path, sizeof(service->stderr_path), IDC_STDERR);\r
}\r
\r
/* See if it works. */\r
return 0;\r
}\r
\r
+static char *browse_filter(int message) {\r
+ switch (message) {\r
+ case NSSM_GUI_BROWSE_FILTER_APPLICATIONS: return "*.exe;*.bat;*.cmd";\r
+ case NSSM_GUI_BROWSE_FILTER_DIRECTORIES: return ".";\r
+ case NSSM_GUI_BROWSE_FILTER_ALL_FILES: /* Fall through. */\r
+ default: return "*.*";\r
+ }\r
+}\r
+\r
+UINT_PTR CALLBACK browse_hook(HWND dlg, UINT message, WPARAM w, LPARAM l) {\r
+ switch (message) {\r
+ case WM_INITDIALOG:\r
+ return 1;\r
+ }\r
+\r
+ return 0;\r
+}\r
+\r
/* Browse for application */\r
-void browse(HWND window) {\r
+void browse(HWND window, char *current, unsigned long flags, ...) {\r
if (! window) return;\r
\r
+ va_list arg;\r
size_t bufsize = 256;\r
size_t len = bufsize;\r
+ int i;\r
+\r
OPENFILENAME ofn;\r
ZeroMemory(&ofn, sizeof(ofn));\r
ofn.lStructSize = sizeof(ofn);\r
/* XXX: Escaping nulls with FormatMessage is tricky */\r
if (ofn.lpstrFilter) {\r
ZeroMemory((void *) ofn.lpstrFilter, bufsize);\r
- char *localised = message_string(NSSM_GUI_BROWSE_FILTER_APPLICATIONS);\r
- _snprintf_s((char *) ofn.lpstrFilter, bufsize, _TRUNCATE, localised);\r
+ len = 0;\r
/* "Applications" + NULL + "*.exe" + NULL */\r
- len = strlen(localised) + 1;\r
- LocalFree(localised);\r
- _snprintf_s((char *) ofn.lpstrFilter + len, bufsize - len, _TRUNCATE, "*.exe");\r
- /* "All files" + NULL + "*.*" + NULL */\r
- len += 6;\r
- localised = message_string(NSSM_GUI_BROWSE_FILTER_ALL_FILES);\r
- _snprintf_s((char *) ofn.lpstrFilter + len, bufsize - len, _TRUNCATE, localised);\r
- len += strlen(localised) + 1;\r
- LocalFree(localised);\r
- _snprintf_s((char *) ofn.lpstrFilter + len, bufsize - len, _TRUNCATE, "*.*");\r
+ va_start(arg, flags);\r
+ while (i = va_arg(arg, int)) {\r
+ char *localised = message_string(i);\r
+ _snprintf_s((char *) ofn.lpstrFilter + len, bufsize, _TRUNCATE, localised);\r
+ len += strlen(localised) + 1;\r
+ LocalFree(localised);\r
+ char *filter = browse_filter(i);\r
+ _snprintf_s((char *) ofn.lpstrFilter + len, bufsize - len, _TRUNCATE, "%s", filter);\r
+ len += strlen(filter) + 1;\r
+ }\r
+ va_end(arg);\r
/* Remainder of the buffer is already zeroed */\r
}\r
ofn.lpstrFile = new char[MAX_PATH];\r
- ofn.lpstrFile[0] = '\0';\r
+ if (flags & OFN_NOVALIDATE) {\r
+ /* Directory hack. */\r
+ _snprintf_s(ofn.lpstrFile, MAX_PATH, _TRUNCATE, ":%s:", message_string(NSSM_GUI_BROWSE_FILTER_DIRECTORIES));\r
+ }\r
+ else _snprintf_s(ofn.lpstrFile, MAX_PATH, _TRUNCATE, "%s", current);\r
ofn.lpstrTitle = message_string(NSSM_GUI_BROWSE_TITLE);\r
ofn.nMaxFile = MAX_PATH;\r
- ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY;\r
+ ofn.Flags = OFN_EXPLORER | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | flags;\r
\r
if (GetOpenFileName(&ofn)) {\r
+ /* Directory hack. */\r
+ if (flags & OFN_NOVALIDATE) strip_basename(ofn.lpstrFile);\r
SendMessage(window, WM_SETTEXT, 0, (LPARAM) ofn.lpstrFile);\r
}\r
if (ofn.lpstrFilter) HeapFree(GetProcessHeap(), 0, (void *) ofn.lpstrFilter);\r
delete[] ofn.lpstrFile;\r
}\r
\r
+INT_PTR CALLBACK tab_dlg(HWND tab, UINT message, WPARAM w, LPARAM l) {\r
+ switch (message) {\r
+ case WM_INITDIALOG:\r
+ return 1;\r
+\r
+ /* Button was pressed or control was controlled. */\r
+ case WM_COMMAND:\r
+ HWND dlg;\r
+ char buffer[MAX_PATH];\r
+\r
+ switch (LOWORD(w)) {\r
+ /* Browse for application. */\r
+ case IDC_BROWSE:\r
+ dlg = GetDlgItem(tab, IDC_PATH);\r
+ GetDlgItemText(tab, IDC_PATH, buffer, sizeof(buffer));\r
+ browse(dlg, buffer, OFN_FILEMUSTEXIST, NSSM_GUI_BROWSE_FILTER_APPLICATIONS, NSSM_GUI_BROWSE_FILTER_ALL_FILES, 0);\r
+ /* Fill in startup directory if it wasn't already specified. */\r
+ GetDlgItemText(tab, IDC_DIR, buffer, sizeof(buffer));\r
+ if (! buffer[0]) {\r
+ GetDlgItemText(tab, IDC_PATH, buffer, sizeof(buffer));\r
+ strip_basename(buffer);\r
+ SetDlgItemText(tab, IDC_DIR, buffer);\r
+ }\r
+ break;\r
+\r
+ /* Browse for startup directory. */\r
+ case IDC_BROWSE_DIR:\r
+ dlg = GetDlgItem(tab, IDC_DIR);\r
+ GetDlgItemText(tab, IDC_DIR, buffer, sizeof(buffer));\r
+ browse(dlg, buffer, OFN_NOVALIDATE, NSSM_GUI_BROWSE_FILTER_DIRECTORIES, 0);\r
+ break;\r
+\r
+ /* Browse for stdin. */\r
+ case IDC_BROWSE_STDIN:\r
+ dlg = GetDlgItem(tab, IDC_STDIN);\r
+ GetDlgItemText(tab, IDC_STDIN, buffer, sizeof(buffer));\r
+ browse(dlg, buffer, 0, NSSM_GUI_BROWSE_FILTER_ALL_FILES, 0);\r
+ break;\r
+\r
+ /* Browse for stdout. */\r
+ case IDC_BROWSE_STDOUT:\r
+ dlg = GetDlgItem(tab, IDC_STDOUT);\r
+ GetDlgItemText(tab, IDC_STDOUT, buffer, sizeof(buffer));\r
+ browse(dlg, buffer, 0, NSSM_GUI_BROWSE_FILTER_ALL_FILES, 0);\r
+ /* Fill in stderr if it wasn't already specified. */\r
+ GetDlgItemText(tab, IDC_STDERR, buffer, sizeof(buffer));\r
+ if (! buffer[0]) {\r
+ GetDlgItemText(tab, IDC_STDOUT, buffer, sizeof(buffer));\r
+ SetDlgItemText(tab, IDC_STDERR, buffer);\r
+ }\r
+ break;\r
+\r
+ /* Browse for stderr. */\r
+ case IDC_BROWSE_STDERR:\r
+ dlg = GetDlgItem(tab, IDC_STDERR);\r
+ GetDlgItemText(tab, IDC_STDERR, buffer, sizeof(buffer));\r
+ browse(dlg, buffer, 0, NSSM_GUI_BROWSE_FILTER_ALL_FILES, 0);\r
+ break;\r
+ }\r
+ return 1;\r
+ }\r
+\r
+ return 0;\r
+}\r
+\r
/* Install/remove dialogue callback */\r
INT_PTR CALLBACK install_dlg(HWND window, UINT message, WPARAM w, LPARAM l) {\r
switch (message) {\r
/* Creating the dialogue */\r
case WM_INITDIALOG:\r
+ HWND tabs;\r
+ HWND combo;\r
+ tabs = GetDlgItem(window, IDC_TAB1);\r
+ if (! tabs) return 0;\r
+\r
+ /* Set up tabs. */\r
+ TCITEM tab;\r
+ ZeroMemory(&tab, sizeof(tab));\r
+ tab.mask = TCIF_TEXT;\r
+\r
+ /* Application tab. */\r
+ tab.pszText = message_string(NSSM_GUI_TAB_APPLICATION);\r
+ tab.cchTextMax = (int) strlen(tab.pszText);\r
+ SendMessage(tabs, TCM_INSERTITEM, NSSM_TAB_APPLICATION, (LPARAM) &tab);\r
+ tablist[NSSM_TAB_APPLICATION] = CreateDialog(0, MAKEINTRESOURCE(IDD_APPLICATION), window, tab_dlg);\r
+ ShowWindow(tablist[NSSM_TAB_APPLICATION], SW_SHOW);\r
+\r
+ /* Shutdown tab. */\r
+ tab.pszText = message_string(NSSM_GUI_TAB_SHUTDOWN);\r
+ tab.cchTextMax = (int) strlen(tab.pszText);\r
+ SendMessage(tabs, TCM_INSERTITEM, NSSM_TAB_SHUTDOWN, (LPARAM) &tab);\r
+ tablist[NSSM_TAB_SHUTDOWN] = CreateDialog(0, MAKEINTRESOURCE(IDD_SHUTDOWN), window, tab_dlg);\r
+ ShowWindow(tablist[NSSM_TAB_SHUTDOWN], SW_HIDE);\r
+\r
+ /* Set defaults. */\r
+ SendDlgItemMessage(tablist[NSSM_TAB_SHUTDOWN], IDC_METHOD_CONSOLE, BM_SETCHECK, BST_CHECKED, 0);\r
+ SetDlgItemInt(tablist[NSSM_TAB_SHUTDOWN], IDC_KILL_CONSOLE, NSSM_KILL_CONSOLE_GRACE_PERIOD, 0);\r
+ SendDlgItemMessage(tablist[NSSM_TAB_SHUTDOWN], IDC_METHOD_WINDOW, BM_SETCHECK, BST_CHECKED, 0);\r
+ SetDlgItemInt(tablist[NSSM_TAB_SHUTDOWN], IDC_KILL_WINDOW, NSSM_KILL_WINDOW_GRACE_PERIOD, 0);\r
+ SendDlgItemMessage(tablist[NSSM_TAB_SHUTDOWN], IDC_METHOD_THREADS, BM_SETCHECK, BST_CHECKED, 0);\r
+ SetDlgItemInt(tablist[NSSM_TAB_SHUTDOWN], IDC_KILL_THREADS, NSSM_KILL_THREADS_GRACE_PERIOD, 0);\r
+ SendDlgItemMessage(tablist[NSSM_TAB_SHUTDOWN], IDC_METHOD_TERMINATE, BM_SETCHECK, BST_CHECKED, 0);\r
+\r
+ /* Restart tab. */\r
+ tab.pszText = message_string(NSSM_GUI_TAB_EXIT);\r
+ tab.cchTextMax = (int) strlen(tab.pszText);\r
+ SendMessage(tabs, TCM_INSERTITEM, NSSM_TAB_EXIT, (LPARAM) &tab);\r
+ tablist[NSSM_TAB_EXIT] = CreateDialog(0, MAKEINTRESOURCE(IDD_APPEXIT), window, tab_dlg);\r
+ ShowWindow(tablist[NSSM_TAB_EXIT], SW_HIDE);\r
+\r
+ /* Set defaults. */\r
+ SetDlgItemInt(tablist[NSSM_TAB_EXIT], IDC_THROTTLE, NSSM_RESET_THROTTLE_RESTART, 0);\r
+ combo = GetDlgItem(tablist[NSSM_TAB_EXIT], IDC_APPEXIT);\r
+ SendMessage(combo, CB_INSERTSTRING, NSSM_EXIT_RESTART, (LPARAM) message_string(NSSM_GUI_EXIT_RESTART));\r
+ SendMessage(combo, CB_INSERTSTRING, NSSM_EXIT_IGNORE, (LPARAM) message_string(NSSM_GUI_EXIT_IGNORE));\r
+ SendMessage(combo, CB_INSERTSTRING, NSSM_EXIT_REALLY, (LPARAM) message_string(NSSM_GUI_EXIT_REALLY));\r
+ SendMessage(combo, CB_INSERTSTRING, NSSM_EXIT_UNCLEAN, (LPARAM) message_string(NSSM_GUI_EXIT_UNCLEAN));\r
+ SendMessage(combo, CB_SETCURSEL, NSSM_EXIT_RESTART, 0);\r
+\r
+ /* I/O tab. */\r
+ tab.pszText = message_string(NSSM_GUI_TAB_IO);\r
+ tab.cchTextMax = (int) strlen(tab.pszText) + 1;\r
+ SendMessage(tabs, TCM_INSERTITEM, NSSM_TAB_IO, (LPARAM) &tab);\r
+ tablist[NSSM_TAB_IO] = CreateDialog(0, MAKEINTRESOURCE(IDD_IO), window, tab_dlg);\r
+ ShowWindow(tablist[NSSM_TAB_IO], SW_HIDE);\r
+\r
+ selected_tab = 0;\r
+\r
return 1;\r
\r
+ /* Tab change. */\r
+ case WM_NOTIFY:\r
+ NMHDR *notification;\r
+\r
+ notification = (NMHDR *) l;\r
+ switch (notification->code) {\r
+ case TCN_SELCHANGE:\r
+ HWND tabs;\r
+ int selection;\r
+\r
+ tabs = GetDlgItem(window, IDC_TAB1);\r
+ if (! tabs) return 0;\r
+\r
+ selection = (int) SendMessage(tabs, TCM_GETCURSEL, 0, 0);\r
+ if (selection != selected_tab) {\r
+ ShowWindow(tablist[selected_tab], SW_HIDE);\r
+ /*\r
+ XXX: Sets focus to the service name which isn't ideal but is\r
+ better than leaving it in another tab.\r
+ */\r
+ ShowWindow(tablist[selection], SW_SHOWDEFAULT);\r
+ SetFocus(tablist[selection]);\r
+ selected_tab = selection;\r
+ }\r
+ return 1;\r
+ }\r
+\r
+ return 0;\r
+\r
/* Button was pressed or control was controlled */\r
case WM_COMMAND:\r
switch (LOWORD(w)) {\r
/* OK button */\r
- case IDC_OK:\r
+ case IDOK:\r
if (! install(window)) PostQuitMessage(0);\r
break;\r
\r
DestroyWindow(window);\r
break;\r
\r
- /* Browse button */\r
- case IDC_BROWSE:\r
- browse(GetDlgItem(window, IDC_PATH));\r
- break;\r
-\r
/* Remove button */\r
case IDC_REMOVE:\r
if (! remove(window)) PostQuitMessage(0);\r
.
MessageId = +1
-SymbolicName = NSSM_GUI_BROWSE_FILTER
+SymbolicName = NSSM_GUI_BROWSE_FILTER_APPLICATIONS
Severity = Informational
Language = English
-Applications%sAll files%s%0
+Applications%0
.
Language = French
-Applications%sTous les fichiers%s%0
+Applications%0
.
Language = Italian
-Applicazioni%sTutti i files%s%0
+Applicazioni%0
.
MessageId = +1
-SymbolicName = NSSM_GUI_BROWSE_FILTER_APPLICATIONS
+SymbolicName = NSSM_GUI_BROWSE_FILTER_DIRECTORIES
Severity = Informational
Language = English
-Applications%0
+Directories%0
.
Language = French
-Applications%0
+Répertoires%0
.
Language = Italian
-Applicazioni%0
+Cartelle%0
.
MessageId = +1
Ricerca file applicazione
.
+MessageId = +1
+SymbolicName = NSSM_GUI_TAB_APPLICATION
+Severity = Informational
+Language = English
+Application
+.
+Language = French
+Application
+.
+Language = Italian
+Applicazione
+.
+
+MessageId = +1
+SymbolicName = NSSM_GUI_TAB_SHUTDOWN
+Severity = Informational
+Language = English
+Shutdown
+.
+Language = French
+Shutdown
+.
+Language = Italian
+Shutdown
+.
+
+MessageId = +1
+SymbolicName = NSSM_GUI_TAB_EXIT
+Severity = Informational
+Language = English
+Exit actions
+.
+Language = French
+Exit actions
+.
+Language = Italian
+Exit actions
+.
+
+MessageId = +1
+SymbolicName = NSSM_GUI_TAB_IO
+Severity = Informational
+Language = English
+I/O
+.
+Language = French
+I/O
+.
+Language = Italian
+I/O
+.
+
+MessageId = +1
+SymbolicName = NSSM_GUI_EXIT_RESTART
+Severity = Informational
+Language = English
+Restart application
+.
+Language = French
+Redémarrer l'application
+.
+Language = Italian
+Riavvare l'applicazione
+.
+
+MessageId = +1
+SymbolicName = NSSM_GUI_EXIT_IGNORE
+Severity = Informational
+Language = English
+No action (srvany compatible)
+.
+Language = French
+No action (srvany compatible)
+.
+Language = Italian
+No action (srvany compatible)
+.
+
+MessageId = +1
+SymbolicName = NSSM_GUI_EXIT_REALLY
+Severity = Informational
+Language = English
+Stop service (oneshot mode)
+.
+Language = French
+Stop service (oneshot mode)
+.
+Language = Italian
+Stop service (oneshot mode)
+.
+
+MessageId = +1
+SymbolicName = NSSM_GUI_EXIT_UNCLEAN
+Severity = Informational
+Language = English
+Fake crash (pre-Vista)
+.
+Language = French
+Fake crash (pre-Vista)
+.
+Language = Italian
+Fake crash (pre-Vista)
+.
+
MessageId = 1001
SymbolicName = NSSM_EVENT_DISPATCHER_FAILED
Severity = Error
La déclaration de l'environnement %1 pour le service %2 n'est pas du type REG_MULTI_SZ. Cette déclaration sera ignorée.
.
Language = Italian
-Dichiarazione di ambiente %1 per il servizio %2 non è di tipo REG_MULTI_SZ e verrà quindi ingnorata.
+Dichiarazione di ambiente %1 per il servizio %2 non è di tipo REG_MULTI_SZ e verrà quindi ignorata.
.
MessageId = +1
#define NSSM_STOP_METHOD_THREADS (1 << 2)\r
#define NSSM_STOP_METHOD_TERMINATE (1 << 3)\r
\r
+/* Exit actions. */\r
+#define NSSM_EXIT_RESTART 0\r
+#define NSSM_EXIT_IGNORE 1\r
+#define NSSM_EXIT_REALLY 2\r
+#define NSSM_EXIT_UNCLEAN 3\r
+#define NSSM_NUM_EXIT_ACTIONS 4\r
+\r
/* How many milliseconds to wait before updating service status. */\r
#define NSSM_SERVICE_STATUS_DEADLINE 20000\r
\r
// Dialog\r
//\r
\r
-IDD_INSTALL DIALOG 0, 0, 220, 90\r
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "NSSM service installer"\r
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r
+IDD_INSTALL DIALOG 0, 0, 286, 126\r
+STYLE DS_MODALFRAME | DS_SETFONT | WS_CAPTION | WS_POPUP | WS_SYSMENU\r
+CAPTION "NSSM service installer"\r
FONT 8, "MS Sans Serif"\r
-BEGIN\r
- DEFPUSHBUTTON "Install service",IDC_OK,55,69,50,14\r
- PUSHBUTTON "Cancel",IDCANCEL,111,69,50,14\r
- EDITTEXT IDC_PATH,48,7,110,14,ES_AUTOHSCROLL\r
- PUSHBUTTON "Browse",IDC_BROWSE,163,7,50,14\r
- EDITTEXT IDC_FLAGS,48,28,165,14,ES_AUTOHSCROLL\r
- LTEXT "Options:",IDC_STATIC,7,31,27,8\r
- LTEXT "Service\nname:",IDC_STATIC,7,49,41,18\r
- EDITTEXT IDC_NAME,48,49,77,14,ES_AUTOHSCROLL\r
- LTEXT "Application:",IDC_STATIC,7,9,38,8\r
-END\r
+{\r
+ CONTROL "", IDC_TAB1, WC_TABCONTROL, 0, 7, 7, 269, 93\r
+ LTEXT "Service name:", IDC_STATIC, 7, 106, 52, 8, SS_LEFT\r
+ EDITTEXT IDC_NAME, 64, 104, 98, 12, ES_AUTOHSCROLL\r
+ DEFPUSHBUTTON "Install service", IDOK, 172, 104, 50, 14\r
+ PUSHBUTTON "Cancel", IDCANCEL, 227, 104, 50, 14\r
+}\r
\r
IDD_REMOVE DIALOG 0, 0, 223, 28\r
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
EDITTEXT IDC_NAME,59,7,87,14,ES_AUTOHSCROLL\r
END\r
\r
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r
+IDD_APPLICATION DIALOG 9, 20, 261, 73\r
+STYLE DS_SHELLFONT | WS_VISIBLE | WS_CHILD | DS_CONTROL\r
+FONT 8, "MS Sans Serif"\r
+{\r
+ GROUPBOX "Application", IDC_STATIC, 7, 7, 251, 58\r
+ LTEXT "Path:", IDC_STATIC, 13, 18, 53, 8, SS_LEFT\r
+ EDITTEXT IDC_PATH, 70, 16, 167, 12, ES_AUTOHSCROLL, WS_EX_ACCEPTFILES\r
+ DEFPUSHBUTTON "...", IDC_BROWSE, 239, 15, 15, 14\r
+ LTEXT "Startup directory:", IDC_STATIC, 13, 34, 53, 8, SS_LEFT\r
+ EDITTEXT IDC_DIR, 70, 32, 167, 12, ES_AUTOHSCROLL, WS_EX_ACCEPTFILES\r
+ DEFPUSHBUTTON "...", IDC_BROWSE_DIR, 239, 31, 15, 14\r
+ LTEXT "Options:", IDC_STATIC, 13, 50, 53, 8, SS_LEFT\r
+ EDITTEXT IDC_FLAGS, 70, 48, 184, 12, ES_AUTOHSCROLL, WS_EX_ACCEPTFILES\r
+}\r
+\r
+\r
+\r
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL\r
+IDD_SHUTDOWN DIALOG 9, 20, 261, 75\r
+STYLE DS_SHELLFONT | WS_VISIBLE | WS_CHILD | DS_CONTROL\r
+FONT 8, "MS Sans Serif"\r
+{\r
+ GROUPBOX "Shutdown", IDC_STATIC, 7, 7, 251, 68\r
+ AUTOCHECKBOX "Generate Control-C", IDC_METHOD_CONSOLE, 13, 18, 76, 8\r
+ LTEXT "Timeout:", IDC_STATIC, 135, 18, 26, 8, SS_LEFT\r
+ EDITTEXT IDC_KILL_CONSOLE, 163, 16, 29, 12, ES_AUTOHSCROLL | ES_NUMBER\r
+ LTEXT "ms", IDC_STATIC, 194, 18, 10, 8, SS_LEFT\r
+ AUTOCHECKBOX "Send WM_CLOSE to windows", IDC_METHOD_WINDOW, 13, 32, 113, 8\r
+ LTEXT "Timeout:", IDC_STATIC, 135, 32, 26, 8, SS_LEFT\r
+ EDITTEXT IDC_KILL_WINDOW, 163, 30, 29, 12, ES_AUTOHSCROLL | ES_NUMBER\r
+ LTEXT "ms", IDC_STATIC, 194, 32, 10, 8, SS_LEFT\r
+ AUTOCHECKBOX "Post WM_QUIT to threads", IDC_METHOD_THREADS, 13, 46, 100, 8\r
+ EDITTEXT IDC_KILL_THREADS, 163, 44, 29, 12, ES_AUTOHSCROLL | ES_NUMBER\r
+ LTEXT "ms", IDC_STATIC, 194, 46, 10, 8, SS_LEFT\r
+ LTEXT "Timeout:", IDC_STATIC, 135, 46, 26, 8, SS_LEFT\r
+ AUTOCHECKBOX "Terminate process", IDC_METHOD_TERMINATE, 13, 60, 74, 8\r
+}\r
+\r
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL\r
+IDD_APPEXIT DIALOG 9, 20, 261, 73\r
+STYLE DS_SHELLFONT | WS_VISIBLE | WS_CHILD | DS_CONTROL\r
+FONT 8, "MS Sans Serif"\r
+{\r
+ GROUPBOX "Throttling", IDC_STATIC, 7, 7, 251, 25\r
+ LTEXT "Delay restart if application runs for less than", IDC_STATIC, 13, 18, 137, 8, SS_LEFT\r
+ EDITTEXT IDC_THROTTLE, 152, 16, 29, 12, ES_AUTOHSCROLL | ES_NUMBER\r
+ LTEXT "ms", IDC_STATIC, 186, 18, 10, 8, SS_LEFT\r
+ GROUPBOX "Restart", IDC_STATIC, 7, 33, 251, 35\r
+ LTEXT "Action to take when application exits other\nthan in response to a controlled service\nshutdown:", IDC_STATIC, 14, 42, 134, 24, SS_LEFT\r
+ COMBOBOX IDC_APPEXIT, 153, 47, 100, 120, CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_TABSTOP\r
+}\r
+\r
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL\r
+IDD_IO DIALOG 9, 20, 261, 73\r
+STYLE DS_SHELLFONT | WS_VISIBLE | WS_CHILD | DS_CONTROL\r
+FONT 8, "MS Sans Serif"\r
+{\r
+ GROUPBOX "I/O redirection", IDC_STATIC, 7, 7, 251, 58\r
+ LTEXT "Input (stdin):", IDC_STATIC, 13, 18, 53, 8, SS_LEFT\r
+ EDITTEXT IDC_STDIN, 70, 16, 167, 12, ES_AUTOHSCROLL, WS_EX_ACCEPTFILES\r
+ DEFPUSHBUTTON "...", IDC_BROWSE_STDIN, 239, 15, 15, 14\r
+ LTEXT "Output (stdout):", IDC_STATIC, 13, 34, 53, 8, SS_LEFT\r
+ EDITTEXT IDC_STDOUT, 70, 32, 167, 12, ES_AUTOHSCROLL, WS_EX_ACCEPTFILES\r
+ DEFPUSHBUTTON "...", IDC_BROWSE_STDOUT, 239, 31, 15, 14\r
+ LTEXT "Error (stderr):", IDC_STATIC, 13, 50, 53, 8, SS_LEFT\r
+ EDITTEXT IDC_STDERR, 70, 48, 167, 12, ES_AUTOHSCROLL, WS_EX_ACCEPTFILES\r
+ DEFPUSHBUTTON "...", IDC_BROWSE_STDERR, 239, 47, 15, 14\r
+}\r
+\r
\r
/////////////////////////////////////////////////////////////////////////////\r
//\r
#pragma code_page(1252)\r
#endif //_WIN32\r
\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Icon\r
+//\r
+\r
+// Icon with lowest ID value placed first to ensure application icon\r
+// remains consistent on all systems.\r
+IDI_NSSM ICON "nssm.ico"\r
+\r
/////////////////////////////////////////////////////////////////////////////\r
//\r
// Dialog\r
//\r
\r
-IDD_INSTALL DIALOG 0, 0, 220, 90\r
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "Installation d'un service NSSM"\r
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH\r
+IDD_INSTALL DIALOG 0, 0, 282, 126\r
+STYLE DS_MODALFRAME | DS_SETFONT | WS_CAPTION | WS_POPUP | WS_SYSMENU\r
+CAPTION "Installation d'un service NSSM"\r
FONT 8, "MS Sans Serif"\r
-BEGIN\r
- DEFPUSHBUTTON "Installer le service",IDC_OK,49,69,75,14\r
- PUSHBUTTON "Annuler",IDCANCEL,131,69,50,14\r
- EDITTEXT IDC_PATH,48,7,110,14,ES_AUTOHSCROLL\r
- PUSHBUTTON "Parcourir",IDC_BROWSE,163,7,50,14\r
- EDITTEXT IDC_FLAGS,48,28,165,14,ES_AUTOHSCROLL\r
- LTEXT "Options:",IDC_STATIC,7,31,27,8\r
- LTEXT "Nom du\nservice:",IDC_STATIC,7,49,41,18\r
- EDITTEXT IDC_NAME,48,49,77,14,ES_AUTOHSCROLL\r
- LTEXT "Application:",IDC_STATIC,7,9,38,8\r
-END\r
+{\r
+ CONTROL "", IDC_TAB1, WC_TABCONTROL, 0, 7, 7, 269, 93\r
+ LTEXT "Nom du service:", IDC_STATIC, 7, 106, 52, 8, SS_LEFT\r
+ EDITTEXT IDC_NAME, 64, 104, 98, 12, ES_AUTOHSCROLL\r
+ DEFPUSHBUTTON "Installer le service", IDOK, 172, 106, 50, 14\r
+ PUSHBUTTON "Anuller", IDCANCEL, 227, 106, 50, 14\r
+}\r
\r
IDD_REMOVE DIALOG 0, 0, 223, 28\r
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
EDITTEXT IDC_NAME,43,7,90,14,ES_AUTOHSCROLL\r
END\r
\r
+LANGUAGE LANG_FRENCH, SUBLANG_FRENCH\r
+IDD_APPLICATION DIALOG 9, 20, 261, 73\r
+STYLE DS_SHELLFONT | WS_VISIBLE | WS_CHILD | DS_CONTROL\r
+FONT 8, "MS Sans Serif"\r
+{\r
+ GROUPBOX "Application", IDC_STATIC, 7, 7, 251, 58\r
+ LTEXT "Chemin:", IDC_STATIC, 13, 18, 53, 8, SS_LEFT\r
+ EDITTEXT IDC_PATH, 80, 16, 157, 12, ES_AUTOHSCROLL, WS_EX_ACCEPTFILES\r
+ DEFPUSHBUTTON "...", IDC_BROWSE, 239, 15, 15, 14\r
+ LTEXT "Rép. de démarrage:", IDC_STATIC, 13, 32, 64, 8, SS_LEFT\r
+ EDITTEXT IDC_DIR, 80, 30, 157, 12, ES_AUTOHSCROLL, WS_EX_ACCEPTFILES\r
+ DEFPUSHBUTTON "...", IDC_BROWSE_DIR, 239, 30, 15, 14\r
+ LTEXT "Options:", IDC_STATIC, 13, 47, 53, 8, SS_LEFT\r
+ EDITTEXT IDC_FLAGS, 80, 45, 174, 12, ES_AUTOHSCROLL, WS_EX_ACCEPTFILES\r
+}\r
+\r
+\r
/////////////////////////////////////////////////////////////////////////////\r
//\r
// DESIGNINFO\r
//\r
\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Version\r
+//\r
+\r
+VS_VERSION_INFO VERSIONINFO\r
+ FILEVERSION NSSM_VERSIONINFO\r
+ PRODUCTVERSION NSSM_VERSIONINFO\r
+ FILEFLAGSMASK 0x17L\r
+#ifdef _DEBUG\r
+ FILEFLAGS 0x1L\r
+#else\r
+ FILEFLAGS 0x0L\r
+#endif\r
+ FILEOS 0x4L\r
+ FILETYPE 0x1L\r
+ FILESUBTYPE 0x0L\r
+BEGIN\r
+ BLOCK "StringFileInfo"\r
+ BEGIN\r
+ END\r
+ BLOCK "VarFileInfo"\r
+ BEGIN\r
+ END\r
+END\r
+\r
#endif // French resources\r
/////////////////////////////////////////////////////////////////////////////\r
\r
// Dialog\r
//\r
\r
-IDD_INSTALL DIALOG 0, 0, 220, 90\r
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "NSSM - Installazione Servizio"\r
LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN\r
+IDD_INSTALL DIALOG 0, 0, 282, 126\r
+STYLE DS_MODALFRAME | DS_SETFONT | WS_CAPTION | WS_POPUP | WS_SYSMENU\r
+CAPTION "NSSM - Installazione Servizio"\r
FONT 8, "MS Sans Serif"\r
-BEGIN\r
- DEFPUSHBUTTON "Installa servizio",IDC_OK,49,69,58,14\r
- PUSHBUTTON "Annulla",IDCANCEL,111,69,50,14\r
- EDITTEXT IDC_PATH,48,7,110,14,ES_AUTOHSCROLL\r
- PUSHBUTTON "Sfoglia...",IDC_BROWSE,163,7,50,14\r
- EDITTEXT IDC_FLAGS,48,28,165,14,ES_AUTOHSCROLL\r
- LTEXT "Opzioni:",IDC_STATIC,7,31,27,8\r
- LTEXT "Nome\nservizio:",IDC_STATIC,7,49,41,18\r
- EDITTEXT IDC_NAME,48,49,77,14,ES_AUTOHSCROLL\r
- LTEXT "Applicazione:",IDC_STATIC,2,9,43,8\r
-END\r
+{\r
+ CONTROL "", IDC_TAB1, WC_TABCONTROL, 0, 7, 7, 269, 93\r
+ LTEXT "Nome servizio:", IDC_STATIC, 7, 106, 52, 8, SS_LEFT\r
+ EDITTEXT IDC_NAME, 64, 104, 98, 12, ES_AUTOHSCROLL\r
+ DEFPUSHBUTTON "Installa servizio", IDOK, 172, 106, 50, 14\r
+ PUSHBUTTON "Anulla", IDCANCEL, 227, 106, 50, 14\r
+}\r
\r
IDD_REMOVE DIALOG 0, 0, 223, 28\r
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
EDITTEXT IDC_NAME,59,7,87,14,ES_AUTOHSCROLL\r
END\r
\r
+LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN\r
+IDD_APPLICATION DIALOG 9, 20, 261, 73\r
+STYLE DS_SHELLFONT | WS_VISIBLE | WS_CHILD | DS_CONTROL\r
+FONT 8, "MS Sans Serif"\r
+{\r
+ GROUPBOX "Applicazione", IDC_STATIC, 7, 7, 251, 58\r
+ LTEXT "Path:", IDC_STATIC, 13, 18, 53, 8, SS_LEFT\r
+ EDITTEXT IDC_PATH, 70, 16, 167, 12, ES_AUTOHSCROLL, WS_EX_ACCEPTFILES\r
+ DEFPUSHBUTTON "...", IDC_BROWSE, 239, 16, 15, 14\r
+ LTEXT "Cartella di avvio:", IDC_STATIC, 13, 32, 53, 8, SS_LEFT\r
+ EDITTEXT IDC_DIR, 70, 30, 167, 12, ES_AUTOHSCROLL, WS_EX_ACCEPTFILES\r
+ DEFPUSHBUTTON "...", IDC_BROWSE_DIR, 239, 30, 15, 14\r
+ LTEXT "Opzioni:", IDC_STATIC, 13, 47, 53, 8, SS_LEFT\r
+ EDITTEXT IDC_FLAGS, 70, 46, 184, 12, ES_AUTOHSCROLL, WS_EX_ACCEPTFILES\r
+}\r
+\r
\r
/////////////////////////////////////////////////////////////////////////////\r
//\r
END\r
#endif // APSTUDIO_INVOKED\r
\r
-#endif // English (U.K.) resources\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Version\r
+//\r
+\r
+VS_VERSION_INFO VERSIONINFO\r
+ FILEVERSION NSSM_VERSIONINFO\r
+ PRODUCTVERSION NSSM_VERSIONINFO\r
+ FILEFLAGSMASK 0x17L\r
+#ifdef _DEBUG\r
+ FILEFLAGS 0x1L\r
+#else\r
+ FILEFLAGS 0x0L\r
+#endif\r
+ FILEOS 0x4L\r
+ FILETYPE 0x1L\r
+ FILESUBTYPE 0x0L\r
+BEGIN\r
+ BLOCK "StringFileInfo"\r
+ BEGIN\r
+ END\r
+ BLOCK "VarFileInfo"\r
+ BEGIN\r
+ END\r
+END\r
+\r
+#endif // Italian (Italy) resources\r
/////////////////////////////////////////////////////////////////////////////\r
\r
\r
#include "messages.rc"\r
/////////////////////////////////////////////////////////////////////////////\r
#endif // not APSTUDIO_INVOKED\r
-\r
#include "nssm.h"\r
\r
+extern const char *exit_action_strings[];\r
+\r
int create_messages() {\r
HKEY key;\r
\r
/* Try to register the module but don't worry so much on failure */\r
RegSetValueEx(key, "EventMessageFile", 0, REG_SZ, (const unsigned char *) path, (unsigned long) strlen(path) + 1);\r
unsigned long types = EVENTLOG_INFORMATION_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_ERROR_TYPE;\r
- RegSetValueEx(key, "TypesSupported", 0, REG_DWORD, /*XXX*/(PBYTE) &types, sizeof(types));\r
+ RegSetValueEx(key, "TypesSupported", 0, REG_DWORD, (const unsigned char *) &types, sizeof(types));\r
\r
return 0;\r
}\r
}\r
\r
/* Try to create the parameters */\r
- if (RegSetValueEx(key, NSSM_REG_EXE, 0, REG_EXPAND_SZ, (const unsigned char *) service->exe, (unsigned long) strlen(service->exe) + 1) != ERROR_SUCCESS) {\r
- log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_SETVALUE_FAILED, NSSM_REG_EXE, error_string(GetLastError()), 0);\r
+ if (set_expand_string(key, NSSM_REG_EXE, service->exe)) {\r
RegDeleteKey(HKEY_LOCAL_MACHINE, NSSM_REGISTRY);\r
RegCloseKey(key);\r
return 3;\r
}\r
- if (RegSetValueEx(key, NSSM_REG_FLAGS, 0, REG_EXPAND_SZ, (const unsigned char *) service->flags, (unsigned long) strlen(service->flags) + 1) != ERROR_SUCCESS) {\r
- log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_SETVALUE_FAILED, NSSM_REG_FLAGS, error_string(GetLastError()), 0);\r
+ if (set_expand_string(key, NSSM_REG_FLAGS, service->flags)) {\r
RegDeleteKey(HKEY_LOCAL_MACHINE, NSSM_REGISTRY);\r
RegCloseKey(key);\r
return 4;\r
}\r
- if (RegSetValueEx(key, NSSM_REG_DIR, 0, REG_EXPAND_SZ, (const unsigned char *) service->dir, (unsigned long) strlen(service->dir) + 1) != ERROR_SUCCESS) {\r
- log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_SETVALUE_FAILED, NSSM_REG_DIR, error_string(GetLastError()), 0);\r
+ if (set_expand_string(key, NSSM_REG_DIR, service->dir)) {\r
RegDeleteKey(HKEY_LOCAL_MACHINE, NSSM_REGISTRY);\r
RegCloseKey(key);\r
return 5;\r
}\r
\r
- /* Close registry */\r
+ /* Other non-default parameters. May fail. */\r
+ unsigned long stop_method_skip = ~service->stop_method;\r
+ if (stop_method_skip) set_number(key, NSSM_REG_STOP_METHOD_SKIP, stop_method_skip);\r
+ if (service->default_exit_action < NSSM_NUM_EXIT_ACTIONS) create_exit_action(service->name, exit_action_strings[service->default_exit_action]);\r
+ if (service->throttle_delay != NSSM_RESET_THROTTLE_RESTART) set_number(key, NSSM_REG_THROTTLE, service->throttle_delay);\r
+ if (service->kill_console_delay != NSSM_KILL_CONSOLE_GRACE_PERIOD) set_number(key, NSSM_REG_KILL_CONSOLE_GRACE_PERIOD, service->kill_console_delay);\r
+ if (service->kill_window_delay != NSSM_KILL_WINDOW_GRACE_PERIOD) set_number(key, NSSM_REG_KILL_WINDOW_GRACE_PERIOD, service->kill_window_delay);\r
+ if (service->kill_threads_delay != NSSM_KILL_THREADS_GRACE_PERIOD) set_number(key, NSSM_REG_KILL_THREADS_GRACE_PERIOD, service->kill_threads_delay);\r
+ if (service->stdin_path[0]) set_expand_string(key, NSSM_REG_STDIN, service->stdin_path);\r
+ if (service->stdout_path[0]) set_expand_string(key, NSSM_REG_STDOUT, service->stdout_path);\r
+ if (service->stderr_path[0]) set_expand_string(key, NSSM_REG_STDERR, service->stderr_path);\r
+\r
+ /* Close registry. */\r
RegCloseKey(key);\r
\r
return 0;\r
// Microsoft Developer Studio generated include file.\r
// Used by nssm.rc\r
//\r
+#define IDC_STATIC (-1)\r
#define IDI_NSSM 101\r
#define IDD_INSTALL 102\r
#define IDD_REMOVE 103\r
+#define IDD_APPLICATION 104\r
+#define IDD_IO 105\r
+#define IDD_APPEXIT 106\r
+#define IDD_SHUTDOWN 107\r
#define IDC_PATH 1000\r
-#define IDC_OK 1001\r
+#define IDC_TAB1 1001\r
#define IDC_CANCEL 1002\r
#define IDC_BROWSE 1003\r
#define IDC_FLAGS 1004\r
#define IDC_NAME 1005\r
#define IDC_REMOVE 1007\r
+#define IDC_METHOD_CONSOLE 1008\r
+#define IDC_METHOD_WINDOW 1009\r
+#define IDC_METHOD_THREADS 1010\r
+#define IDC_METHOD_TERMINATE 1011\r
+#define IDC_KILL_CONSOLE 1012\r
+#define IDC_KILL_WINDOW 1013\r
+#define IDC_KILL_THREADS 1014\r
+#define IDC_STDIN 1015\r
+#define IDC_STDOUT 1016\r
+#define IDC_STDERR 1017\r
+#define IDC_BROWSE_STDIN 1018\r
+#define IDC_BROWSE_STDOUT 1019\r
+#define IDC_BROWSE_STDERR 1020\r
+#define IDC_THROTTLE 1021\r
+#define IDC_APPEXIT 1022\r
+#define IDC_DIR 1023\r
+#define IDC_BROWSE_DIR 1024\r
\r
// Next default values for new objects\r
// \r
#ifdef APSTUDIO_INVOKED\r
#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE 104\r
+#define _APS_NEXT_RESOURCE_VALUE 108\r
#define _APS_NEXT_COMMAND_VALUE 40001\r
-#define _APS_NEXT_CONTROL_VALUE 1009\r
+#define _APS_NEXT_CONTROL_VALUE 1024\r
#define _APS_NEXT_SYMED_VALUE 101\r
#endif\r
#endif\r
+\r
\r
extern imports_t imports;\r
\r
-static enum { NSSM_EXIT_RESTART, NSSM_EXIT_IGNORE, NSSM_EXIT_REALLY, NSSM_EXIT_UNCLEAN } exit_actions;\r
-static const char *exit_action_strings[] = { "Restart", "Ignore", "Exit", "Suicide", 0 };\r
+const char *exit_action_strings[] = { "Restart", "Ignore", "Exit", "Suicide", 0 };\r
\r
static inline int throttle_milliseconds(unsigned long throttle) {\r
/* pow() operates on doubles. */\r
char flags[VALUE_LENGTH];\r
char dir[MAX_PATH];\r
char *env;\r
+ char stdin_path[MAX_PATH];\r
+ char stdout_path[MAX_PATH];\r
+ char stderr_path[MAX_PATH];\r
+ unsigned long default_exit_action;\r
unsigned long throttle_delay;\r
unsigned long stop_method;\r
unsigned long kill_console_delay;\r