SDK NBI Installer:

- remove all products with current version when uninstalling
- remove app link for OSX when uninstalling

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10167 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent 6bb13f9f62
commit 65806b16f9
  1. 10
      sdk/nbi/stub/ext/components/products/helloworld/src/org/mycompany/ConfigurationLogic.java
  2. 31
      sdk/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/sequences/MainSequence.java

@ -7,6 +7,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Locale;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.mycompany.wizard.panels.HelloWorldPanel;
import org.mycompany.installer.utils.applications.NetBeansRCPUtils;
import org.netbeans.installer.product.components.ProductConfigurationLogic;
@ -301,6 +303,14 @@ public class ConfigurationLogic extends ProductConfigurationLogic {
//ignore
}
}
} else{
String appName=ResourceUtils.getString(ConfigurationLogic.class, "CL.app.name");
File exeLink = new File(installLocation.getParentFile().getParent()+"/MacOS/"+appName);
try {
FileUtils.deleteWithEmptyParents(exeLink);
} catch (IOException ex) {
LogManager.log("Error removing app Link: " + ex);
}
}
/////////////////////////////////////////////////////////////////////////////
//remove cluster/update files

@ -49,6 +49,8 @@ import org.netbeans.installer.product.components.Product;
import org.netbeans.installer.product.Registry;
import org.netbeans.installer.utils.ResourceUtils;
import org.netbeans.installer.utils.helper.ExecutionMode;
import org.netbeans.installer.utils.helper.Status;
import org.netbeans.installer.utils.helper.Version;
import org.netbeans.installer.wizard.components.WizardSequence;
import org.netbeans.installer.wizard.components.actions.DownloadConfigurationLogicAction;
import org.netbeans.installer.wizard.components.actions.DownloadInstallationDataAction;
@ -88,13 +90,23 @@ public class MainSequence extends WizardSequence {
installAction.setProperty(InstallAction.DESCRIPTION_PROPERTY,
DEFAULT_IA_DESCRIPTION);
}
@Override
public void executeForward() {
final Registry registry = Registry.getInstance();
final List<Product> toInstall = registry.getProductsToInstall();
final List<Product> toUninstall = registry.getProductsToUninstall();
//normen - uninstall all other items with same version number
if (toUninstall.size() > 0) {
Version ver;
ver = toUninstall.get(0).getVersion();
List<Product> products = registry.getProducts();
for (Product product : products) {
if (product.getVersion().equals(ver)) {
product.setStatus(Status.TO_BE_UNINSTALLED);
}
}
}
// remove all current children (if there are any), as the components
// selection has probably changed and we need to rebuild from scratch
getChildren().clear();
@ -116,9 +128,9 @@ public class MainSequence extends WizardSequence {
}
//normen - use first product path for all projects -> no separate path
// wizards needed
if(initProduct == null){
if (initProduct == null) {
initProduct = product;
}else{
} else {
addChild(new CopyInstallLocationAction(initProduct, product));
}
addChild(productSequences.get(product));
@ -133,19 +145,19 @@ public class MainSequence extends WizardSequence {
if (toInstall.size() > 0) {
addChild(downloadInstallationDataAction);
addChild(installAction);
addChild(installAction);
}
addChild(postInstallSummaryPanel);
super.executeForward();
}
@Override
public boolean canExecuteForward() {
return ExecutionMode.NORMAL == ExecutionMode.getCurrentExecutionMode() &&
(Registry.getInstance().getProductsToInstall().size() > 0 ||
Registry.getInstance().getProductsToUninstall().size() > 0);
return ExecutionMode.NORMAL == ExecutionMode.getCurrentExecutionMode()
&& (Registry.getInstance().getProductsToInstall().size() > 0
|| Registry.getInstance().getProductsToUninstall().size() > 0);
}
/////////////////////////////////////////////////////////////////////////////////
// Constants
@ -157,5 +169,4 @@ public class MainSequence extends WizardSequence {
ResourceUtils.getString(
MainSequence.class,
"MS.IA.description"); // NOI18N
}

Loading…
Cancel
Save