In order to be coherent with the graphical UI and because it is more intuitive option, substitute the "noWindowsService" option of the CLI setup by "enableWindowsService" option. The WIKI has been updated to reflect these changes.
| | |
| | | BooleanArgument showUsage; |
| | | BooleanArgument silentInstall; |
| | | BooleanArgument skipPortCheck; |
| | | BooleanArgument noWindowsService; |
| | | BooleanArgument enableWindowsService; |
| | | FileBasedArgument rootPWFile; |
| | | IntegerArgument ldapPort; |
| | | IntegerArgument jmxPort; |
| | |
| | | null, null, MSGID_INSTALLDS_DESCRIPTION_ROOTPWFILE); |
| | | argParser.addArgument(rootPWFile); |
| | | |
| | | noWindowsService = new BooleanArgument("nowindowsservice", 'n', |
| | | "noWindowsService", |
| | | MSGID_INSTALLDS_DESCRIPTION_NO_WINDOWS_SERVICE); |
| | | enableWindowsService = new BooleanArgument("enablewindowsservice", 'e', |
| | | "enableWindowsService", |
| | | MSGID_INSTALLDS_DESCRIPTION_ENABLE_WINDOWS_SERVICE); |
| | | if (SetupUtils.isWindows()) |
| | | { |
| | | argParser.addArgument(noWindowsService); |
| | | argParser.addArgument(enableWindowsService); |
| | | } |
| | | |
| | | showUsage = new BooleanArgument("help", OPTION_SHORT_HELP, |
| | |
| | | CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 842; |
| | | |
| | | /** |
| | | * The message ID for the message for the description of the No Windows |
| | | * The message ID for the message for the description of the Enable Windows |
| | | * service. This does not take any argument. |
| | | */ |
| | | public static final int MSGID_INSTALLDS_DESCRIPTION_NO_WINDOWS_SERVICE = |
| | | public static final int MSGID_INSTALLDS_DESCRIPTION_ENABLE_WINDOWS_SERVICE = |
| | | CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 843; |
| | | |
| | | |
| | |
| | | registerMessage(MSGID_INSTALLDS_DESCRIPTION_ROOTPWFILE, |
| | | "Specifies the path to a file containing the password " + |
| | | "for the initial root user for the Directory Server"); |
| | | registerMessage(MSGID_INSTALLDS_DESCRIPTION_NO_WINDOWS_SERVICE, |
| | | "Do not enable OpenDS to run as a Windows Service"); |
| | | registerMessage(MSGID_INSTALLDS_DESCRIPTION_ENABLE_WINDOWS_SERVICE, |
| | | "Enable OpenDS to run as a Windows Service"); |
| | | registerMessage(MSGID_INSTALLDS_DESCRIPTION_HELP, |
| | | "Display this usage information"); |
| | | registerMessage(MSGID_INSTALLDS_NO_CONFIG_FILE, |
| | |
| | | BooleanArgument showUsage; |
| | | BooleanArgument silentInstall; |
| | | BooleanArgument skipPortCheck; |
| | | BooleanArgument noWindowsService; |
| | | BooleanArgument enableWindowsService; |
| | | FileBasedArgument rootPWFile; |
| | | IntegerArgument ldapPort; |
| | | IntegerArgument jmxPort; |
| | |
| | | null, null, MSGID_INSTALLDS_DESCRIPTION_ROOTPWFILE); |
| | | argParser.addArgument(rootPWFile); |
| | | |
| | | noWindowsService = new BooleanArgument("nowindowsservice", 'n', |
| | | "noWindowsService", |
| | | MSGID_INSTALLDS_DESCRIPTION_NO_WINDOWS_SERVICE); |
| | | enableWindowsService = new BooleanArgument("enablewindowsservice", 'e', |
| | | "enableWindowsService", |
| | | MSGID_INSTALLDS_DESCRIPTION_ENABLE_WINDOWS_SERVICE); |
| | | if (SetupUtils.isWindows()) |
| | | { |
| | | argParser.addArgument(noWindowsService); |
| | | argParser.addArgument(enableWindowsService); |
| | | } |
| | | |
| | | showUsage = new BooleanArgument("help", OPTION_SHORT_HELP, |
| | |
| | | { |
| | | if (silentInstall.isPresent()) |
| | | { |
| | | enableService = !noWindowsService.isPresent(); |
| | | enableService = enableWindowsService.isPresent(); |
| | | } |
| | | else if (noWindowsService.isPresent()) |
| | | else if (enableWindowsService.isPresent()) |
| | | { |
| | | enableService = false; |
| | | enableService = true; |
| | | } |
| | | else |
| | | { |
| | |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filename"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsNoWindowsService" type="optional"> |
| | | <function-arg-def name="dsEnableWindowsService" type="optional"> |
| | | <function-arg-description> |
| | | Do not enable as a Windows Service |
| | | Enable as a Windows Service |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="boolean"/> |
| | | </function-arg-def> |
| | |
| | | if dsBindPwdFile: |
| | | STAFCmdParamsList.append('-j "%s"' % dsBindPwdFile) |
| | | |
| | | if dsNoWindowsService: |
| | | STAFCmdParamsList.append('-n') |
| | | if dsEnableWindowsService: |
| | | STAFCmdParamsList.append('-e') |
| | | |
| | | if dsHelp: |
| | | STAFCmdParamsList.append('-H') |
| | |
| | | <if expr="isWindows"> |
| | | |
| | | <script> |
| | | noWindowsService='true' |
| | | enableWindowsService='' |
| | | </script> |
| | | |
| | | <else> |
| | | |
| | | <script> |
| | | noWindowsService='' |
| | | enableWindowsService='' |
| | | </script> |
| | | |
| | | </else> |
| | |
| | | 'dsBindDN' : dsBindDN, |
| | | 'dsBindPwd' : dsBindPwd, |
| | | 'dsBaseDN' : dsBaseDN, |
| | | 'dsNoWindowsService' : noWindowsService } |
| | | 'dsEnableWindowsService' : enableWindowsService} |
| | | </call> |
| | | |
| | | <call function="'checkRC'"> |
| | |
| | | args.add(Integer.toString(jmxPort)); |
| | | args.add("-w"); |
| | | args.add(DIRECTORY_MANAGER_PASSWORD); |
| | | if (isWindows()) { |
| | | args.add("-n"); // don't install Windows service |
| | | } |
| | | |
| | | ProcessBuilder pb = new ProcessBuilder(args); |
| | | Process p = pb.start(); |
| | | if (p.waitFor() != 0) { |
| | |
| | | static public File getQuickSetupTestServerRootDir() { |
| | | return new File(getQuickSetupTestWorkspace(), "OpenDS"); |
| | | } |
| | | |
| | | static public boolean isWindows() { |
| | | return File.separator.equals("\\"); |
| | | } |
| | | } |