Auto Update in Install4J - Software Update with Silent Version Check
When we have a programm running on multiple client PC and we need an Auto Update. For Java Install4J provides Installer which can be used on on any platform.
It is easy but very difficult as no clear help is available.
AutoUpdate.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package autoupdater;
import com.install4j.api.launcher.*;
import com.install4j.api.update.*;
import com.install4j.api.Util;
import javax.swing.JOptionPane;
/**
*
* @author rehmanm
*/
public class AutoUpdate {
static AutoUpdate AutoUpdateObj;
public static AutoUpdate getInstance(){
if (AutoUpdateObj ==null)
AutoUpdateObj = new AutoUpdate();
return AutoUpdateObj;
}
private AutoUpdate(){
}
public void Update(){
try {
JOptionPane.showMessageDialog(null, "Download Location " + Util.getUserHome());
JOptionPane.showMessageDialog(null, "Possible Entry : " + UpdateChecker.getUpdateDescriptor("http://localhost/website/updates.xml",
ApplicationDisplayMode.GUI).getPossibleUpdateEntry());
// Location where Updateable version is available
if (UpdateChecker.getUpdateDescriptor("http://localhost/ website/updates.xml",
ApplicationDisplayMode.GUI).getPossibleUpdateEntry() != null) {
//Process_ID is the ID of Installer - In my case it is 61
//Install4J Package Image
ApplicationLauncher.launchApplication("Process_ID", null, false, new ApplicationLauncher.Callback() {
public void exited(int exitValue) {
JOptionPane.showMessageDialog(null, "exited" + exitValue);
//java.lang.System.exit(exitValue);
}
public void prepareShutdown() {
JOptionPane.showMessageDialog(null, "prepareShutdown");
//Method shutdown the application
}
});
}
} catch(Exception ex) {
ex.printStackTrace();
JOptionPane.showMessageDialog(null, ex.getMessage());
}
JOptionPane.showMessageDialog(null, "End");
}

}
Things to remember.
Please provide the complete path with xmlfile name in Update Descriptor URL as mentioned in the image.

Include i4jrunimte.jar in your project can be found in the installation directory in resource folder.
In my computer it is C:\Program Files\install4j\resource\i4jruntime.jar. It may be changed in your system.
It is easy but very difficult as no clear help is available.
AutoUpdate.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package autoupdater;
import com.install4j.api.launcher.*;
import com.install4j.api.update.*;
import com.install4j.api.Util;
import javax.swing.JOptionPane;
/**
*
* @author rehmanm
*/
public class AutoUpdate {
static AutoUpdate AutoUpdateObj;
public static AutoUpdate getInstance(){
if (AutoUpdateObj ==null)
AutoUpdateObj = new AutoUpdate();
return AutoUpdateObj;
}
private AutoUpdate(){
}
public void Update(){
try {
JOptionPane.showMessageDialog(null, "Download Location " + Util.getUserHome());
JOptionPane.showMessageDialog(null, "Possible Entry : " + UpdateChecker.getUpdateDescriptor("http://localhost/website/updates.xml",
ApplicationDisplayMode.GUI).getPossibleUpdateEntry());
// Location where Updateable version is available
if (UpdateChecker.getUpdateDescriptor("http://localhost/
ApplicationDisplayMode.GUI).getPossibleUpdateEntry() != null) {
//Process_ID is the ID of Installer - In my case it is 61
public void exited(int exitValue) {
JOptionPane.showMessageDialog(null, "exited" + exitValue);
//java.lang.System.exit(exitValue);
}
public void prepareShutdown() {
JOptionPane.showMessageDialog(null, "prepareShutdown");
//Method shutdown the application
}
});
}
} catch(Exception ex) {
ex.printStackTrace();
JOptionPane.showMessageDialog(null, ex.getMessage());
}
JOptionPane.showMessageDialog(null, "End");
}

}
Things to remember.
Please provide the complete path with xmlfile name in Update Descriptor URL as mentioned in the image.
Include i4jrunimte.jar in your project can be found in the installation directory in resource folder.
In my computer it is C:\Program Files\install4j\resource\i4jruntime.jar. It may be changed in your system.
Comments
Install4J Crack
I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. I hope to have many more entries or so from you.
Very interesting blog.
visual-studio-code-crack
install4j-crack