diff --git a/sdk/nbi/stub/ext/components/products/helloworld/src/org/mycompany/ConfigurationLogic.java b/sdk/nbi/stub/ext/components/products/helloworld/src/org/mycompany/ConfigurationLogic.java index bfa6fa199..8ed320ea7 100644 --- a/sdk/nbi/stub/ext/components/products/helloworld/src/org/mycompany/ConfigurationLogic.java +++ b/sdk/nbi/stub/ext/components/products/helloworld/src/org/mycompany/ConfigurationLogic.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 diff --git a/sdk/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/sequences/MainSequence.java b/sdk/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/sequences/MainSequence.java index 64e52bbc5..d4e6721ca 100644 --- a/sdk/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/sequences/MainSequence.java +++ b/sdk/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/sequences/MainSequence.java @@ -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 toInstall = registry.getProductsToInstall(); final List toUninstall = registry.getProductsToUninstall(); - + //normen - uninstall all other items with same version number + if (toUninstall.size() > 0) { + Version ver; + ver = toUninstall.get(0).getVersion(); + List 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 - }