private File makeShortCutFile = null;
private File removeShortCutFile = null;
+ private static String REMOVE_ALL_PACKAGES = "Remove all packages...";
+ private static String REMOVE_ALL_SDK_FILES = "Remove all SDK files...";
private InstallManager() {
}
for (Package pkg : downloadPkgSet) {
if (monitor != null) {
- monitor.setPackageName(pkg.getPackageName());
+ monitor.setProgressTitle(pkg.getPackageName());
}
if (monitor != null && monitor.isCanceled()) {
Log.log("Install package '" + pkg + "'");
if (monitor != null) {
- monitor.setPackageName(pkg.getPackageName());
+ monitor.setProgressTitle(pkg.getPackageName());
}
Installer installer = new Installer();
// save target directory
initializeTargetDir(targetDir);
+
+ //if distribution is changed, remove all packages and install.
+ if (mConfig.isDistributionChanged()) {
+ removeAllPackages(monitor);
+ } else {
+ // remove missing packages
+ removeMissingPackages(monitor);
- // remove missing packages
- removeMissingPackages(monitor);
-
- // remove conflict packages
- if (!removeConflictPackages(installablePackages, monitor)) {
- Log.err("Cannot remove conflict package");
- throw new IMFatalException(
- ErrorCode.CONFIG_CANNOT_REMOVE_CONFLICT_PACKAGES);
- }
+ // remove conflict packages
+ if (!removeConflictPackages(installablePackages, monitor)) {
+ Log.err("Cannot remove conflict package");
+ throw new IMFatalException(
+ ErrorCode.CONFIG_CANNOT_REMOVE_CONFLICT_PACKAGES);
+ }
- boolean result = false;
- //If Options.snapshot is true, remove installed packages that differernt version from installable packages.
- if (Options.snapshot) {
- result = removeDifferentVersionPackages(installablePackages, monitor);
- } else {
- result = removeUpdatablePackages(installablePackages, monitor);
- }
-
- if (!result) {
- Log.err("Cannot remove updatable package");
- throw new IMFatalException(
- ErrorCode.CONFIG_CANNOT_REMOVE_UPDATABLE_PACKAGES);
+ boolean result = false;
+ //If Options.snapshot is true, remove installed packages that differernt version from installable packages.
+ if (Options.snapshot) {
+ result = removeDifferentVersionPackages(installablePackages, monitor);
+ } else {
+ result = removeUpdatablePackages(installablePackages, monitor);
+ }
+
+ if (!result) {
+ Log.err("Cannot remove updatable package");
+ throw new IMFatalException(
+ ErrorCode.CONFIG_CANNOT_REMOVE_UPDATABLE_PACKAGES);
+ }
}
//start installation
Log.log("Remove missing packages => " + missingPackages);
if (monitor != null) {
- monitor.setPackageName("Remove Missing Packages");
+ monitor.setProgressTitle("Remove Missing Packages");
}
for (Package pkg : missingPackages) {
Log.log("Remove conflict packages => " + conflictPackages);
if (monitor != null) {
- monitor.setPackageName("Remove Conflict Packages");
+ monitor.setProgressTitle("Remove Conflict Packages");
}
return remove(conflictPackages);
Log.log("Remove packages in snapshot => " + updatablePackages);
if (monitor != null) {
- monitor.setPackageName("Remove updatable Packages");
+ monitor.setProgressTitle("Remove updatable Packages");
}
return remove(updatablePackages);
Log.log("Remove updatable packages => " + updatablePackages);
if (monitor != null) {
- monitor.setPackageName("Remove updatable Packages");
+ monitor.setProgressTitle("Remove updatable Packages");
}
return remove(updatablePackages);
}
if (monitor != null) {
- monitor.setPackageName(pkg.getPackageName());
+ monitor.setProgressTitle(pkg.getPackageName());
}
Installer installer = new Installer();
removeAll(monitor);
} else {
// not exist to remove
- removeSDK();
+ removeSDK(monitor);
}
}
public void removeAll(IIMProgressMonitor monitor) {
Log.log("InstallManager.removeAll()");
+ removeAllPackages(monitor);
+ removeSDK(monitor);
+ }
+
+ private void removeAllPackages(IIMProgressMonitor monitor) {
+ Log.log("Remove all packages.");
+
+ if (monitor != null) {
+ monitor.setProgressTitle(REMOVE_ALL_PACKAGES);
+ }
+
PackageSet removablePackages = packageManager.getInstalledPackages();
for (Package pkg : removablePackages) {
Log.err("InstallManager.removeAll remove fail => " + pkg);
}
}
-
- removeSDK();
}
/**
* Remove All of TizenSDK files.
*/
- public void removeSDK() {
+ public void removeSDK(IIMProgressMonitor monitor) {
Log.log("InstallManager removeSDK start");
+
+ if (monitor != null) {
+ monitor.setProgressTitle(REMOVE_ALL_SDK_FILES);
+ }
removeInstallManager();
removeChangeLog();
}
for (Package pkg : packageSet) {
- if (!pkg.isRootMeta() && !pkg.isPartnerMeta() && !pkg.isExtraMeta() && !pkg.isPublicMeta()) {
+ if (!pkg.isMeta()) {
continue;
}
-
- if (!Options.partnerSdk) { // Public SDK case
- if (pkg.isPartnerMeta()) {
- continue;
- }
- } else { // Partner SDK case
- if (pkg.isPublicMeta()) {
- continue;
- }
- }
String packageName = pkg.getPackageName();
Package installedPackage = viewController.getInstalledPackage(packageName);
items.remove(item);
}
private InstallState getState(Package pkg) {
- if (viewController.getInstallableMetaPackageList().contains(pkg)) {
+ if (Config.getInstance().isDistributionChanged()) {
return InstallState.INSTALL;
- } else if (viewController.getUpdatableMetapackageList().contains(pkg)) {
- return InstallState.UPDATE;
} else {
- return InstallState.UNINSTALL;
+ if (viewController.getInstallableMetaPackageList().contains(pkg)) {
+ return InstallState.INSTALL;
+ } else if (viewController.getUpdatableMetapackageList().contains(pkg)) {
+ return InstallState.UPDATE;
+ } else {
+ return InstallState.UNINSTALL;
+ }
}
}