| | |
| | | isWindowsServiceEnabled = ev.getNewDescriptor().isWindowsServiceEnabled(); |
| | | |
| | | final boolean isLocal = ev.getNewDescriptor().isLocal(); |
| | | if ((isLocal != previousLocal) || |
| | | (isWindowsServiceEnabled != previousValue)) |
| | | if (isLocal != previousLocal || isWindowsServiceEnabled != previousValue) |
| | | { |
| | | previousLocal = isLocal; |
| | | SwingUtilities.invokeLater(new Runnable() |
| | |
| | | { |
| | | if (enableService) |
| | | { |
| | | returnCode = ConfigureWindowsService.enableService(outPrintStream, |
| | | errorPrintStream); |
| | | if ((returnCode != ConfigureWindowsService.SERVICE_ALREADY_ENABLED) && |
| | | (returnCode != ConfigureWindowsService.SERVICE_ENABLE_SUCCESS)) |
| | | returnCode = ConfigureWindowsService.enableService(outPrintStream, errorPrintStream); |
| | | if (returnCode != ConfigureWindowsService.SERVICE_ALREADY_ENABLED && |
| | | returnCode != ConfigureWindowsService.SERVICE_ENABLE_SUCCESS) |
| | | { |
| | | state = State.FINISHED_WITH_ERROR; |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | returnCode = ConfigureWindowsService.disableService(outPrintStream, |
| | | errorPrintStream); |
| | | if ((returnCode != ConfigureWindowsService.SERVICE_ALREADY_DISABLED) |
| | | && |
| | | (returnCode != ConfigureWindowsService.SERVICE_DISABLE_SUCCESS)) |
| | | returnCode = ConfigureWindowsService.disableService(outPrintStream, errorPrintStream); |
| | | if (returnCode != ConfigureWindowsService.SERVICE_ALREADY_DISABLED |
| | | && returnCode != ConfigureWindowsService.SERVICE_DISABLE_SUCCESS) |
| | | { |
| | | state = State.FINISHED_WITH_ERROR; |
| | | } |