*/
protected void checkPreviousVersion()
throws InvalidJadException, MIDletSuiteLockedException {
int id;
MIDletSuiteImpl midletSuite;
String installedVersion;
int cmpResult;
// Check if app already exists
id = MIDletSuiteStorage.getSuiteID(info.suiteVendor, info.suiteName);
if (id == MIDletSuite.UNUSED_SUITE_ID) {
// there is no previous version
return;
}
try {
midletSuite =
state.midletSuiteStorage.getMIDletSuite(id, true);
if (midletSuite == null) {
// there is no previous version
return;
}
checkVersionFormat(info.suiteVersion);
state.isPreviousVersion = true;
// This is now an update, use the old ID
info.id = id;
state.previousSuite = midletSuite;
state.previousInstallInfo = midletSuite.getInstallInfo();
if (state.force) {
// do not ask questions, force an overwrite
return;
}
// If it does, check version information
installedVersion = midletSuite.getProperty(
MIDletSuite.VERSION_PROP);
cmpResult = vercmp(info.suiteVersion,
installedVersion);
if (cmpResult < 0) {
// older version, warn user