Ashish Jagtap
Ashish Jagtap

Reputation: 2819

Install4j Prompt user to specify port number to run JBoss Server

I have created a installer to Deploy my web application on JBoss server what I does as follows

Files

  1. HSQLDB Database folder.
  2. JBoss folder including my application war file.

enter image description here

Launcher

In this section I have created two launchers

  1. first to unzip/extract the given Directories (Generated Launcher)
  2. another launcher to execute standalone.sh file of my JBoss server (External Launcher)

enter image description here

Installer

here I have added 3 Action

  1. to change the access mode of standalone.sh and server.log file
  2. Execute Launcher action to start JBoss server

enter image description here

when I run the installer then every thing works fine and it will start my JBoss to but problem is JBoss by default run on port 8080 thus if this port in use then it will not start my JBoss server now what I wanted to do is that

Upvotes: 1

Views: 346

Answers (1)

Ingo Kegel
Ingo Kegel

Reputation: 48035

You can ask the user for the port value with a configurable form:

  1. Select the installer node, and click on the add button, then on "Add screen" and choose the "Configurable form".

  2. Add a "Text field with integer format" form component to ask for the port. The form component saves the user input to an installer variable, say to "jbossPort".

  3. Use a "Replace text in XML files" action to change the port in the XML configuration file of JBoss. The port value is referenced like this: ${installer:jbossPort}, it is also available from the variable chooser (small arrow next to all text fields, select "Insert installer runtime varaiable", then select the "Bound variables" tab).

Upvotes: 3

Related Questions