From: Iain Patterson Date: Fri, 15 Nov 2013 15:48:56 +0000 (+0000) Subject: Don't automatically close the GUI on error. X-Git-Tag: v2.18~2 X-Git-Url: http://git.iain.cx/?p=nssm.git;a=commitdiff_plain;h=961ffcf2e9dba8795ad9019124822d9288442b6f Don't automatically close the GUI on error. If a parameter in the GUI was missing or invalid we were closing the dialogue and forcing the user to relaunch the installer/remover. Instead we now loop until the service has successfully been installed/removed or the user cancelled the operation. --- diff --git a/gui.cpp b/gui.cpp index 7955b1a..c45347f 100644 --- a/gui.cpp +++ b/gui.cpp @@ -205,7 +205,7 @@ INT_PTR CALLBACK install_dlg(HWND window, UINT message, WPARAM w, LPARAM l) { switch (LOWORD(w)) { /* OK button */ case IDC_OK: - PostQuitMessage(install(window)); + if (! install(window)) PostQuitMessage(0); break; /* Cancel button */ @@ -220,7 +220,7 @@ INT_PTR CALLBACK install_dlg(HWND window, UINT message, WPARAM w, LPARAM l) { /* Remove button */ case IDC_REMOVE: - PostQuitMessage(remove(window)); + if (! remove(window)) PostQuitMessage(0); break; } return 1;