Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Obtain version information from prior installation

Tags:

java

install4j

Running the "Update current installation" option, how do I obtain the version info from the prior installation? I've been through the API and the closest thing I've seen is the public static interface ApplicationRegistry.ApplicationInfo.

Edit
This is how I am currently going about it. It works but am not sure if this is the most feasible method.

import com.install4j.api.ApplicationRegistry;

ApplicationRegistry.ApplicationInfo[] AppInfo = ApplicationRegistry.getApplicationInfoById(context.getApplicationId());

return AppInfo[0].getVersion();
like image 897
user0000001 Avatar asked Oct 23 '25 12:10

user0000001


1 Answers

You could use the

static ApplicationRegistry.ApplicationInfo getApplicationInfoByDir(java.io.File dir)

Checks if the specified directory contains an application installed by install4j and retrieves information about it.

This will return a ApplicationInfo instead of the ApplicationInfo[].

like image 169
victor sosa Avatar answered Oct 25 '25 03:10

victor sosa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!