1
votes

I'm using the 6.1.3 evaluation version of Install4j on MacOS 10.12 and would like to launch an Auto Updater with Silent Version check from within my application and pass the URL for updates.xml as a Launcher Integration parameter.

I used the launcher integration wizard to create this code:

// This will return immediately if you call it from the EDT,
// otherwise it will block until the installer application exits
ApplicationLauncher.launchApplicationInProcess("9248", new String[] {"-DmyUpdateURL=" + MY_UPDATE_URL}, new ApplicationLauncher.Callback() {
    public void exited(int exitValue) {
        //TODO add your code here (not invoked on event dispatch thread)
    }

    public void prepareShutdown() {
        //TODO add your code here (not invoked on event dispatch thread)
    }
}, ApplicationLauncher.WindowMode.FRAME, null

);

I would like to use myUpdateURL in Auto-Update Options -> URL for updates.xml field. How do I reference myUpdateURL from within Install4J? Or if I'm going about this wrong, how does one pass the URL for updates.xml to the auto updater via launcher integration?

Thanks in advance!

1

1 Answers

1
votes

I would like to use myUpdateURL in Auto-Update Options -> URL for updates.xml field.

This is not possible, because that information is fixed at compile-time. You have to change the use-site of that information at runtime, there you can use an installer variable.

Please follow these steps:

  1. Under Installer->Screens & Actions, select the update application and pre-define an installer variable myUpdateURL with type string and the value ${compiler:sys.updatesUrl}.

  2. Locate the "Check for update" action in your updater application and change the value of the "Update descriptor URL" property to ${installer:myUpdateURL} (you can use the installer variable selector to do that)

  3. Start your updater with the argument "-VmyUpdateURL=" + MY_UPDATE_URL