Reputation: 57
Backgound info... I maintain an install4j project for product "A". We are in the process of developing a new product, "B", and product management has mandated that it have its own install4j-based installer.
It might be worth noting that there is no fileystem overlap or shared libraries between these two products. That is, they will be installed to unique directories on the same system (e.g. /opt/myCompany/prodA
, /opt/myCompany/ProdB
).
However, product "B" requires that product "A" be installed on the same system. But product "A" is not dependent on "B". So the installer for product "B" will need to be able to authoritatively determine if product "A" is already installed on the same machine, and if not, then install it.
Questions: Does install4j maintain some kind of persistent registry of products that it installs, so that the installer for product "B" can authoritatively determine if its dependent product ("A") is already installed on the system? And perhaps even query for installation/product details (e.g. version, install directory)?
If not, I can always add some scripting logic to search for telltale signs of product "A" (e.g. look for the Windows Service named "A"), or have the user browse to product A's installation directory, but I would prefer to at least try a better/built-in way to accomplish this task, if install4j provides for this?
Finally, and somewhat as an aside, if product "A" is not already installed on the System, then I plan to use the "Run executable or batch file" action to install it from media. I mention this hoping for an affirmation that this is the correct approach to this problem.
Thanks for any and all help!
Upvotes: 2
Views: 479
Reputation: 48090
install4j exposes such functionality in the API with the ApplicationRegistry class:
http://resources.ej-technologies.com/install4j/help/api/com/install4j/api/ApplicationRegistry.html
A code snippet using this class is:
ApplicationRegistry.ApplicationInfo[] applicationInfos =
ApplicationRegistry.getApplicationInfoById("other app ID");
if (applicationInfos.length > 0) {
context.setVariable("otherAppInstalled", applicationInfos.length > 0);
context.setVariable("otherAppInstallationDir",
applicationInfos[0].getInstallationDirectory().getPath());
}
Upvotes: 2