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
This commit is contained in:
parent
6bb13f9f62
commit
65806b16f9
@ -7,6 +7,8 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
import org.mycompany.wizard.panels.HelloWorldPanel;
|
import org.mycompany.wizard.panels.HelloWorldPanel;
|
||||||
import org.mycompany.installer.utils.applications.NetBeansRCPUtils;
|
import org.mycompany.installer.utils.applications.NetBeansRCPUtils;
|
||||||
import org.netbeans.installer.product.components.ProductConfigurationLogic;
|
import org.netbeans.installer.product.components.ProductConfigurationLogic;
|
||||||
@ -301,6 +303,14 @@ public class ConfigurationLogic extends ProductConfigurationLogic {
|
|||||||
//ignore
|
//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
|
//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.product.Registry;
|
||||||
import org.netbeans.installer.utils.ResourceUtils;
|
import org.netbeans.installer.utils.ResourceUtils;
|
||||||
import org.netbeans.installer.utils.helper.ExecutionMode;
|
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.WizardSequence;
|
||||||
import org.netbeans.installer.wizard.components.actions.DownloadConfigurationLogicAction;
|
import org.netbeans.installer.wizard.components.actions.DownloadConfigurationLogicAction;
|
||||||
import org.netbeans.installer.wizard.components.actions.DownloadInstallationDataAction;
|
import org.netbeans.installer.wizard.components.actions.DownloadInstallationDataAction;
|
||||||
@ -94,7 +96,17 @@ public class MainSequence extends WizardSequence {
|
|||||||
final Registry registry = Registry.getInstance();
|
final Registry registry = Registry.getInstance();
|
||||||
final List<Product> toInstall = registry.getProductsToInstall();
|
final List<Product> toInstall = registry.getProductsToInstall();
|
||||||
final List<Product> toUninstall = registry.getProductsToUninstall();
|
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
|
// remove all current children (if there are any), as the components
|
||||||
// selection has probably changed and we need to rebuild from scratch
|
// selection has probably changed and we need to rebuild from scratch
|
||||||
getChildren().clear();
|
getChildren().clear();
|
||||||
@ -116,9 +128,9 @@ public class MainSequence extends WizardSequence {
|
|||||||
}
|
}
|
||||||
//normen - use first product path for all projects -> no separate path
|
//normen - use first product path for all projects -> no separate path
|
||||||
// wizards needed
|
// wizards needed
|
||||||
if(initProduct == null){
|
if (initProduct == null) {
|
||||||
initProduct = product;
|
initProduct = product;
|
||||||
}else{
|
} else {
|
||||||
addChild(new CopyInstallLocationAction(initProduct, product));
|
addChild(new CopyInstallLocationAction(initProduct, product));
|
||||||
}
|
}
|
||||||
addChild(productSequences.get(product));
|
addChild(productSequences.get(product));
|
||||||
@ -143,9 +155,9 @@ public class MainSequence extends WizardSequence {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canExecuteForward() {
|
public boolean canExecuteForward() {
|
||||||
return ExecutionMode.NORMAL == ExecutionMode.getCurrentExecutionMode() &&
|
return ExecutionMode.NORMAL == ExecutionMode.getCurrentExecutionMode()
|
||||||
(Registry.getInstance().getProductsToInstall().size() > 0 ||
|
&& (Registry.getInstance().getProductsToInstall().size() > 0
|
||||||
Registry.getInstance().getProductsToUninstall().size() > 0);
|
|| Registry.getInstance().getProductsToUninstall().size() > 0);
|
||||||
}
|
}
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
// Constants
|
// Constants
|
||||||
@ -157,5 +169,4 @@ public class MainSequence extends WizardSequence {
|
|||||||
ResourceUtils.getString(
|
ResourceUtils.getString(
|
||||||
MainSequence.class,
|
MainSequence.class,
|
||||||
"MS.IA.description"); // NOI18N
|
"MS.IA.description"); // NOI18N
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user