Q:

Download and install update programmatically with install4j api

I have a little question, I am writing an application in which I want to implement some methods to download and install updates for the application.
Checking for updates is no problem and works fine. But, I have problems to implement download and install methods. I found some classes in API but "it's hard to work with".
Download works fine, too but without progress. I don't want to use "check for updates"-action on startup.
This is my current test code for downloading the update:
public static void downloadInstaller(UpdateDescriptorEntry descriptor)
{
    Downloader downloader = new Downloader(0, null); // Don't know what to use instead of 0
    try
    {
        downloader = downloader.connect(descriptor.getURL().toString());

        File outputFile = new File(ApplicationSettings.getCachesDirectoryWithIdentifier() + File.separator + descriptor.getFileName());

        downloader.download(outputFile,
                            descriptor.getFileSize(),
                            false);

        if (descriptor.getFileSize() == outputFile.length()) // Check if download complete
        {
            logger.info("Successful");
        }
        else
        {
            logger.error("Error in download");
        }
    }
    catch (IOException | UserCanceledException e)
    {
        logger.error(e);
    }
}

Now I have two questions.
1) Is it possible to get any download progress? There is a ProgressInterface interface but I don't know how to implement it correctly.
2.) How can I run the installer of the downloaded application programmatically (maybe in unattended mode, too)?
Thanks for helping

A:

Downloader is an internal class in the runtime and not part of the documented API.
You should add an updater application on "Installer->Screens & Actions" step and call that programmatically. The integration wizard on the "Launcher integration" tab has an integration wizard that will provide you with the code snippet for starting the updater.

