X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=gui.cpp;h=9c5c57d74c9fffdecd0b254704f213527538dc1c;hb=cba3331a303deccf228fec50f30a87ed9ec784ce;hp=7cc5bc4efc91d8e3a34f5a4bc980cc6b2266298d;hpb=c1bc67d13894b1b9456fb85abdabc4dbb5d71bcc;p=nssm.git diff --git a/gui.cpp b/gui.cpp index 7cc5bc4..9c5c57d 100644 --- a/gui.cpp +++ b/gui.cpp @@ -87,6 +87,8 @@ int install(HWND window) { nssm_service_t *service = alloc_nssm_service(); if (service) { + set_nssm_service_defaults(service); + /* Get service name. */ if (! GetDlgItemText(window, IDC_NAME, service->name, sizeof(service->name))) { popup_message(MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_SERVICE_NAME); @@ -108,14 +110,13 @@ int install(HWND window) { /* Get flags. */ if (SendMessage(GetDlgItem(tablist[NSSM_TAB_APPLICATION], IDC_FLAGS), WM_GETTEXTLENGTH, 0, 0)) { - if (! GetDlgItemText(window, IDC_FLAGS, service->flags, sizeof(service->flags))) { + if (! GetDlgItemText(tablist[NSSM_TAB_APPLICATION], IDC_FLAGS, service->flags, sizeof(service->flags))) { popup_message(MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_OPTIONS); return 4; } } /* Get stop method stuff. */ - service->stop_method = ~0; check_stop_method(service, NSSM_STOP_METHOD_CONSOLE, IDC_METHOD_CONSOLE); check_stop_method(service, NSSM_STOP_METHOD_WINDOW, IDC_METHOD_WINDOW); check_stop_method(service, NSSM_STOP_METHOD_THREADS, IDC_METHOD_THREADS); @@ -134,16 +135,6 @@ int install(HWND window) { check_io("stdin", service->stdin_path, sizeof(service->stdin_path), IDC_STDIN); check_io("stdout", service->stdout_path, sizeof(service->stdout_path), IDC_STDOUT); check_io("stderr", service->stderr_path, sizeof(service->stderr_path), IDC_STDERR); - /* I/O defaults. */ - service->stdin_sharing = NSSM_STDIN_SHARING; - service->stdin_disposition = NSSM_STDIN_DISPOSITION; - service->stdin_flags = NSSM_STDIN_FLAGS; - service->stdout_sharing = NSSM_STDOUT_SHARING; - service->stdout_disposition = NSSM_STDOUT_DISPOSITION; - service->stdout_flags = NSSM_STDOUT_FLAGS; - service->stderr_sharing = NSSM_STDERR_SHARING; - service->stderr_disposition = NSSM_STDERR_DISPOSITION; - service->stderr_flags = NSSM_STDERR_FLAGS; /* Override stdout and/or stderr. */ if (SendDlgItemMessage(tablist[NSSM_TAB_IO], IDC_TRUNCATE, BM_GETCHECK, 0, 0) & BST_CHECKED) { if (service->stdout_path[0]) service->stdout_disposition = CREATE_ALWAYS;