ulejon
ulejon

Reputation: 641

Download and install additional application with Install4J

I'm using Install4J to build an installation for my application (lets call it MainApp), and it work great.

To be able to use MainApp, you also need to install my second application (lets call this one SecondApp).

My question is this. Is there a way to get Install4J to first install MainApp, and as the last step in the installation download SecondApp (an exe file located on a webserver) and execute it?

Upvotes: 7

Views: 1778

Answers (1)

Ingo Kegel
Ingo Kegel

Reputation: 48105

You can do that by adding two actions to the "Installation" screen:

  • "Download file" action, for downloading the "SecondApp" installer

  • "Run executable or batch file" action, for executing it. Select the "Wait for termination" property to wait for the installer to complete.

To improve user feedback add the following two actions to before the "Run executable or batch file" action:

  • "Set the progress bar" action with "Type of change" set to "Set to indeterminate state"

  • "Set messages" action with "Use status" selected and "Status message" set to "Installing second app ..."

If you do not want to keep the "SecondApp" installer executable, use ${installer:sys.workingDir}/secondapp.exe to download it to the temporary directory of the installer. It will be deleted automatically when the installer exits.

Upvotes: 8

Related Questions