import org.tizen.installmanager.ui.page.InstallingPage.InstallProgressMonitor;
import org.tizen.installmanager.ui.page.WelcomePage.RADIO_ACTION;
import org.tizen.installmanager.util.PathUtil;
+import org.tizen.installmanager.util.ShellUtil;
/**
});
- //checking installmanager update.
- if (Options.doUpdateInstallManager) {
- progressbar.updateName("Checking InstallManager update.\nIt may take a minute...");
-
- shell.getDisplay().asyncExec(new Runnable() {
- public void run() {
- updateInstallManager(shell);
- }
- });
-
- }
-
//init end
progressbar.finish();
}
if (!shell.isDisposed()) {
progressbar.open();
}
-
- if (ErrorController.isInstallManagerUpdatable) {
- throw new IMExitException(Config.EXITCODE_HAS_SELF_UPDATE);
- }
Log.log("Window init end");
}
private void updateInstallManager(Shell shell) {
if (controller.canInstallManagerUpdate()) {
- String msg = "Do you want to update the install-manager?";
- int ret = MessageBoxDlg.showDlg(shell, "InstallManager", msg, DialogType.WARNING, false);
- if (ret == SWT.YES) {
- if (controller.updateInstallManager()) {
- Log.log("InstallManager is updatable.");
- System.out.println("## Success to update the InstallManager, and restart now.");
- ErrorController.isInstallManagerUpdatable = true;
- return;
- } else {
+ String msg = "Install-manager will be updated.\nIt may take a minute...";
+ MessageBoxDlg.showDlg(shell, "InstallManager", msg, DialogType.NOTIFY, false);
+
+ if (controller.updateInstallManager()) {
+ Log.log("## Success to update the InstallManager, and restart now.");
+ System.out.println("## Success to update the InstallManager, and restart now.");
+
+ String binary = PathUtil.get(Registry.getInstalledPath(), Config.INSTALL_MANAGER_DIRECTORY, Config.EXECUTE_FILE_NAME_OF_INSTALL_MANAGER);
+ String command = ShellUtil.addInterpreter(binary);
+ try {
+ Runtime.getRuntime().exec(command);
+ System.exit(0);
+ } catch (IOException e) {
+ Log.ExceptionLog(e);
return;
}
} else {
@Override
public void widgetSelected(SelectionEvent e) {
if (sl_composite.topControl == compositeWelcomePage) {
+ updateInstallManager(e.display.getActiveShell());
addExtraButton.setVisible(false);
btnSettings.setVisible(false);
if (compositeWelcomePage.getSelectedRadioButton() == RADIO_ACTION.INSTALL) {
}
});
- //checking installmanager update.
- if (Options.doUpdateInstallManager) {
- progressbar.updateName("Checking InstallManager update.\nIt may take a minute...");
-
- shell.getDisplay().asyncExec(new Runnable() {
- public void run() {
- updateInstallManager(shell);
- }
- });
-
- }
-
//init end
progressbar.finish();
}
if (!shell.isDisposed()) {
progressbar.open();
}
-
- if (ErrorController.isInstallManagerUpdatable) {
- String binary = PathUtil.get(Registry.getInstalledPath(), Config.INSTALL_MANAGER_DIRECTORY, Config.EXECUTE_FILE_NAME_OF_INSTALL_MANAGER);
- try {
- Runtime.getRuntime().exec(binary);
- } catch (IOException e) {
- Log.ExceptionLog(e);
- }
- System.exit(0);
- }
Log.log("Window refresh end");
}
//get installable packages
PackageSet selectedMetas = packageManager.getPackagesByNames(installList);
- //add mandatory packages
+ //add mandatory packages, madatory packages always reinstall.
selectedMetas.addAll(
- packageManager.getUpdatableMandatoryPackages());
+ packageManager.getMandatoryPackages());
//get set of packages by purpose.
selectedMetas = getMetaPackagesByPurpose(selectedMetas);
- //add install-manager package
- if (!isInstalledInstallManager()) {
- Package installmanagerPkg = packageManager.getPackageByName(InstallManagerConstants.INSTALLMANAGER_PACKAGE_NAME);
-
- if (installmanagerPkg != null) {
- selectedMetas.add(installmanagerPkg);
- }
- }
-
return packageManager.getInstallablePackages(selectedMetas);
}
} else {
String version = Config.getInstance().getCurrentConfigFile().getInstallManagerVersion();
+ if (version == null || version.isEmpty()) {
+ return true;
+ }
+
if (Version.compareTo(new Version(version), pkg.getVersion()) < 0) {
return true;
} else {