IzPack

Ability to set environment variables when using ProcessPanel

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 4.0.0
  • Fix Version/s: 4.1.0
  • Component/s: Installer
  • Labels:
    None
  • Patch Submitted:
    Yes
  • Number of attachments :
    2

Description

Sometimes it is necessary to set specific environment variables when starting processes with ProcessPanel.
I modified ProcessPanelWorker.java to accept <env> elements just as in the following example:

<processing>
<job name="Performing some post install task requiring a specific environment variable">
<os family="windows" />
<executeForPack name="Server files" />
<executefile name="$INSTALL_PATH\bin\postinstall.exe">
<arg>foo</arg>
<arg>bar</arg>
<env>MY_PRODUCT_HOME=$INSTALL_PATH</env>
</executefile>
</job>
</processing>

Activity

Hide
Julien Ponge added a comment -

Sounds good, this will be scheduled for 4.1.0.

I have yet to review the proposed solution, but meanwhile, could you please attach a patch rather than a whole while? Patches are much more convenient to handle

Thanks a lot

Show
Julien Ponge added a comment - Sounds good, this will be scheduled for 4.1.0. I have yet to review the proposed solution, but meanwhile, could you please attach a patch rather than a whole while? Patches are much more convenient to handle Thanks a lot
Hide
Olivier Chédru added a comment -

Here is the patch.

Show
Olivier Chédru added a comment - Here is the patch.
Hide
Julien Ponge added a comment -

Very good.

Can you also add some plain text as a comment that documents the changes from an end-user point of view? I'll commit the patch after that.

Show
Julien Ponge added a comment - Very good. Can you also add some plain text as a comment that documents the changes from an end-user point of view? I'll commit the patch after that.
Hide
Olivier Chédru added a comment -

In addition to <arg> elements, the <executefile> element also accepts <env> elements to set variables in the environment of the target process. This can be useful if this process requires some environment variables, such as its installation directory, to work properly.
An <env> element has the following syntax: <env>variable=value</env>. Note the value supports variable substitution, for example:
<env>MY_PRODUCT_HOME=$INSTALL_PATH</env>.

Show
Olivier Chédru added a comment - In addition to <arg> elements, the <executefile> element also accepts <env> elements to set variables in the environment of the target process. This can be useful if this process requires some environment variables, such as its installation directory, to work properly. An <env> element has the following syntax: <env>variable=value</env>. Note the value supports variable substitution, for example: <env>MY_PRODUCT_HOME=$INSTALL_PATH</env>.
Hide
Julien Ponge added a comment -

Merged with the documentation. Thanks Olivier!

Show
Julien Ponge added a comment - Merged with the documentation. Thanks Olivier!

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: