}
// static public void checkInstallChange(InstallData data, ChooseDirectory panel) {
static public void checkInstallChange(InstallData data) {
Installer installer = InstallerFactory.getInstance();
PackageDescription packageData = SetupDataProvider.getPackageDescription();
if ( data.getUpdatePackage() == null ) {
setUpdatePackage(packageData, data);
}
if ( data.getUpdatePackage() != null ) {
// resetting values, if database was changed during user installation
data.setOlderVersionExists(false);
data.setNewerVersionExists(false);
data.setSameVersionExists(false);
boolean packageIsInstalled = installer.isPackageInstalled(data.getUpdatePackage(), data);
if ( packageIsInstalled ) {
// Checking version of installed package:
// If installed package is older: Force update mode, no selection of packages
// If installed package is equal: Force maintenance mode, only selection of packages
// If installed package is newer: Abort installation with message
// Setting specific values for the different update scenarios
if ( installer.isInstalledPackageOlder(data.getUpdatePackage(), data) ) {
data.setOlderVersionExists(true);
// All installed packages will be updated -> determining which packages are installed
System.err.println("An older product is installed");
// But if this is a kind of Major Upgrade with different Minor and therefore different package names,
// it is necessary to remove the old product.
if ( data.getProductMinor() > data.getInstalledProductMinor() )
{
data.setMajorUpgrade(true);
System.err.println("Major Upgrade");
}
} else if ( installer.isInstallSetPackageOlder(data.getUpdatePackage(), data) ) {
data.setNewerVersionExists(true);
System.err.println("A newer product is installed");
} else {
data.setSameVersionExists(true);
System.err.println("Same product is installed");