1
votes

My add-on installer cannot find the previous installation at the "Welcome" screen if it is installed in a non-standard location. To get around this, I run a pre-activation script to look up the location by id and set the installation directory variable. The salient code:

ApplicationRegistry.ApplicationInfo[] applicationInfos = ApplicationRegistry.getApplicationInfoById(appid);

File dir = applicationInfos[0].getInstallationDirectory();

context.setInstallationDirectory(dir);

This works on Linux (the welcome screen prompts to confirm the update) but not on Windows (the customary welcome screen is displayed). On Windows, the subsequent screen prompts with the correct directory, which matches what is in the Registry.

So, is this the correct way to do this in install4j version 5.1.6?

Thanks for the help!

1
This script is not needed for add-on installers. Are you sure that your settings on Installer->Update options are correct, especially the application ID of the main product? - Ingo Kegel
On both Linux-64 and Windows-64, I have found that without this script, the add-on installer does not find the previous installation when the application is installed anywhere other than the default location (specified under Configure Media Files). I am sure the application ID is correct because I look up appid using String appid = (String)context.getAddOnApplicationId() and the script returns the correct directory. Thanks for the help! - user3170795
So is the problem just the welcome screen? For an add-on installer, the "Alert for update installation" property of that screen should not be selected. - Ingo Kegel
Yes, the problem is just the welcome screen, just on Windows, and just for a non-standard installation location. If I deselect the "Alert for update installation" then the welcome screen does not prompt for the update on Linux or Windows. With this Alert selected, there is a prompt for update on Linux but not Windows. I would prefer to show an alert because there is no indication in the dialogs that the user is doing an update, not a reinstall. Thanks for the suggestion. - user3170795
Thank you, I got it now. If you want an interim build that fixes this issue, please contact [email protected]. Otherwise you can exchange the "Welcome" screen with your own form screen. The add-on installer will always install into an existing installation, otherwise it just hows a message dialog. - Ingo Kegel

1 Answers

1
votes

This is a bug that will be fixed in 5.1.11.