Nicholas DiPiazza
Nicholas DiPiazza

Reputation: 10595

install4j - when doing "install-service" can we prompt for the different options?

I created an install4j installer for our product.

We are using it exclusively for Windows installer creation. One of the main reasons is to handle the Windows Service installation automatically.

But there are various configurable parameters that need to be prompted for:

I want to prompt the user for some of these.

I'm pretty sure the only way to do this is to create a form.

Is there someone out there who has already done this that I can steal the work from?

Otherwise I'll be having to learn a whole lot more about install4j installer actions, forms, variables, etc and it will take some considerable time.

Upvotes: 1

Views: 114

Answers (1)

Ingo Kegel
Ingo Kegel

Reputation: 48005

The basic workflow for wiring user input to properties of actions is this:

  • Add a form to the installer
  • Add a form component to that form which is suitable for the property of interest, for example a "Check box" form component for the "Restart on failure" property or a "Text field" form component for the "Account name or SID" property
  • Each form component is bound to an installer variable whose name you have to configure, say "accountName" for the "Account name or SID" property.
  • In the action configuration, enter ${installer:accountName} to use this variable value.
  • For non-text field properties, right-click the property and choose "Switch to text mode" from the context menu first

An example form that is suitable for your purpose is contained in the "hello" sample project that is included with install4j. Go to the "Installer->Screen & Actions" step and locate the "Service options" form under the "Installer" node.

Upvotes: 1

Related Questions