Merge branch 'master' of github.com:sleuthkit/autopsy

This commit is contained in:
Brian Carrier 2013-09-24 12:31:45 -04:00
commit 4943f8242e
13 changed files with 622 additions and 463 deletions

View File

@ -101,7 +101,7 @@ class AddImageWizardAddingProgressPanel implements WizardDescriptor.Panel<Wizard
*/ */
void setStateStarted() { void setStateStarted() {
component.getProgressBar().setIndeterminate(true); component.getProgressBar().setIndeterminate(true);
component.setProgressBarTextAndColor("*This process take some time for large data sources.", 0, Color.black); component.setProgressBarTextAndColor("*This process may take some time for large data sources.", 0, Color.black);
} }
/** /**

View File

@ -62,6 +62,9 @@ class OpenRecentCasePanel extends javax.swing.JPanel {
// If there are any images, let's select the first one // If there are any images, let's select the first one
if (imagesTable.getRowCount() > 0) { if (imagesTable.getRowCount() > 0) {
imagesTable.setRowSelectionInterval(0, 0); imagesTable.setRowSelectionInterval(0, 0);
openButton.setEnabled(true);
} else {
openButton.setEnabled(false);
} }
} }

View File

@ -49,7 +49,7 @@ import org.sleuthkit.datamodel.TskException;
public class DataContentViewerArtifact extends javax.swing.JPanel implements DataContentViewer{ public class DataContentViewerArtifact extends javax.swing.JPanel implements DataContentViewer{
private final static Logger logger = Logger.getLogger(DataContentViewerArtifact.class.getName()); private final static Logger logger = Logger.getLogger(DataContentViewerArtifact.class.getName());
private final static String WAIT_TEXT = "Preparing display, please wait..."; private final static String WAIT_TEXT = "Retrieving and preparing data, please wait...";
private final static String ERROR_TEXT = "Error retrieving result"; private final static String ERROR_TEXT = "Error retrieving result";
private Node currentNode; // @@@ Remove this when the redundant setNode() calls problem is fixed. private Node currentNode; // @@@ Remove this when the redundant setNode() calls problem is fixed.
private int currentPage = 1; private int currentPage = 1;

View File

@ -26,10 +26,15 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.JTabbedPane; import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import org.openide.explorer.ExplorerManager; import org.openide.explorer.ExplorerManager;
import org.openide.nodes.Node; import org.openide.nodes.Node;
import org.openide.nodes.NodeEvent;
import org.openide.nodes.NodeListener;
import org.openide.nodes.NodeMemberEvent;
import org.openide.nodes.NodeReorderEvent;
import org.openide.util.Lookup; import org.openide.util.Lookup;
import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataContent; import org.sleuthkit.autopsy.corecomponentinterfaces.DataContent;
@ -59,6 +64,7 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C
private DataContent customContentViewer; private DataContent customContentViewer;
private boolean isMain; private boolean isMain;
private String title; private String title;
private final DummyNodeListener dummyNodeListener = new DummyNodeListener();
private static final Logger logger = Logger.getLogger(DataResultPanel.class.getName() ); private static final Logger logger = Logger.getLogger(DataResultPanel.class.getName() );
private boolean listeningToTabbedPane = false; private boolean listeningToTabbedPane = false;
@ -340,56 +346,80 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C
@Override @Override
public void setNode(Node selectedNode) { public void setNode(Node selectedNode) {
if (this.rootNode != null) {
this.rootNode.removeNodeListener(dummyNodeListener);
}
// Deferring becoming a listener to the tabbed pane until this point // Deferring becoming a listener to the tabbed pane until this point
// eliminates handling a superfluous stateChanged event during construction. // eliminates handling a superfluous stateChanged event during construction.
if (listeningToTabbedPane == false) { if (listeningToTabbedPane == false) {
dataResultTabbedPanel.addChangeListener(this); dataResultTabbedPanel.addChangeListener(this);
listeningToTabbedPane = true; listeningToTabbedPane = true;
} }
this.rootNode = selectedNode; this.rootNode = selectedNode;
if (this.rootNode != null) {
this.rootNode.addNodeListener(dummyNodeListener);
}
setupTabs(selectedNode);
if (selectedNode != null) { if (selectedNode != null) {
int childrenCount = selectedNode.getChildren().getNodesCount(true); int childrenCount = selectedNode.getChildren().getNodesCount();
this.numberMatchLabel.setText(Integer.toString(childrenCount)); this.numberMatchLabel.setText(Integer.toString(childrenCount));
} }
this.numberMatchLabel.setVisible(true); this.numberMatchLabel.setVisible(true);
resetTabs(selectedNode); resetTabs(selectedNode);
//update/disable tabs based on if supported for this node // set the display on the current active tab
int drvC = 0;
for (UpdateWrapper drv : viewers) {
if (drv.isSupported(selectedNode)) {
dataResultTabbedPanel.setEnabledAt(drvC, true);
} else {
dataResultTabbedPanel.setEnabledAt(drvC, false);
}
++drvC;
}
// if the current tab is no longer enabled, then find one that is
boolean hasViewerEnabled = true;
int currentActiveTab = this.dataResultTabbedPanel.getSelectedIndex(); int currentActiveTab = this.dataResultTabbedPanel.getSelectedIndex();
if ((currentActiveTab == -1) || (dataResultTabbedPanel.isEnabledAt(currentActiveTab) == false)) { if (currentActiveTab != -1) {
hasViewerEnabled = false; UpdateWrapper drv = viewers.get(currentActiveTab);
for (int i = 0; i < dataResultTabbedPanel.getTabCount(); i++) { drv.setNode(selectedNode);
if (dataResultTabbedPanel.isEnabledAt(i)) { }
currentActiveTab = i; }
hasViewerEnabled = true;
break; private void setupTabs(final Node selectedNode) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
//update/disable tabs based on if supported for this node
int drvC = 0;
for (UpdateWrapper drv : viewers) {
if (drv.isSupported(selectedNode)) {
dataResultTabbedPanel.setEnabledAt(drvC, true);
} else {
dataResultTabbedPanel.setEnabledAt(drvC, false);
}
++drvC;
}
// if the current tab is no longer enabled, then find one that is
boolean hasViewerEnabled = true;
int currentActiveTab = dataResultTabbedPanel.getSelectedIndex();
if ((currentActiveTab == -1) || (dataResultTabbedPanel.isEnabledAt(currentActiveTab) == false)) {
hasViewerEnabled = false;
for (int i = 0; i < dataResultTabbedPanel.getTabCount(); i++) {
if (dataResultTabbedPanel.isEnabledAt(i)) {
currentActiveTab = i;
hasViewerEnabled = true;
break;
}
}
if (hasViewerEnabled) {
dataResultTabbedPanel.setSelectedIndex(currentActiveTab);
}
}
if (hasViewerEnabled) {
viewers.get(currentActiveTab).setNode(selectedNode);
} }
} }
});
if (hasViewerEnabled) {
dataResultTabbedPanel.setSelectedIndex(currentActiveTab);
}
}
if (hasViewerEnabled) {
viewers.get(currentActiveTab).setNode(selectedNode);
}
} }
@Override @Override
@ -579,4 +609,34 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C
public void setNumMatches(int numMatches) { public void setNumMatches(int numMatches) {
this.numberMatchLabel.setText(Integer.toString(numMatches)); this.numberMatchLabel.setText(Integer.toString(numMatches));
} }
private class DummyNodeListener implements NodeListener {
private static final String DUMMY_NODE_DISPLAY_NAME = "Please Wait...";
@Override
public void childrenAdded(final NodeMemberEvent nme) {
Node added = nme.getNode();
if (added.getDisplayName().equals(DUMMY_NODE_DISPLAY_NAME)) {
// don't set up tabs if the new node is a waiting node
return;
}
setupTabs(nme.getNode());
}
@Override
public void childrenRemoved(NodeMemberEvent nme) {
}
@Override
public void childrenReordered(NodeReorderEvent nre) {
}
@Override
public void nodeDestroyed(NodeEvent ne) {
}
@Override
public void propertyChange(PropertyChangeEvent evt) {
}
}
} }

View File

@ -22,14 +22,17 @@ import java.awt.Cursor;
import java.awt.FontMetrics; import java.awt.FontMetrics;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.dnd.DnDConstants; import java.awt.dnd.DnDConstants;
import java.beans.PropertyChangeEvent;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.logging.Level;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import org.netbeans.swing.outline.DefaultOutlineModel; import org.netbeans.swing.outline.DefaultOutlineModel;
import org.openide.explorer.ExplorerManager; import org.openide.explorer.ExplorerManager;
import org.openide.explorer.view.OutlineView; import org.openide.explorer.view.OutlineView;
@ -38,6 +41,10 @@ import org.openide.nodes.Children;
import org.openide.nodes.Node; import org.openide.nodes.Node;
import org.openide.nodes.Node.Property; import org.openide.nodes.Node.Property;
import org.openide.nodes.Node.PropertySet; import org.openide.nodes.Node.PropertySet;
import org.openide.nodes.NodeEvent;
import org.openide.nodes.NodeListener;
import org.openide.nodes.NodeMemberEvent;
import org.openide.nodes.NodeReorderEvent;
import org.openide.nodes.Sheet; import org.openide.nodes.Sheet;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer; import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer;
@ -53,6 +60,7 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
private String firstColumnLabel = "Name"; private String firstColumnLabel = "Name";
private Set<Property> propertiesAcc = new LinkedHashSet<>(); private Set<Property> propertiesAcc = new LinkedHashSet<>();
private static final Logger logger = Logger.getLogger(DataResultViewerTable.class.getName()); private static final Logger logger = Logger.getLogger(DataResultViewerTable.class.getName());
private final DummyNodeListener dummyNodeListener = new DummyNodeListener();
/** /**
* Creates a DataResultViewerTable object that is compatible with node * Creates a DataResultViewerTable object that is compatible with node
@ -241,11 +249,38 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
hasChildren = selectedNode.getChildren().getNodesCount() > 0; hasChildren = selectedNode.getChildren().getNodesCount() > 0;
} }
Node oldNode = this.em.getRootContext();
if (oldNode != null) {
oldNode.removeNodeListener(dummyNodeListener);
}
// if there's no selection node, do nothing // if there's no selection node, do nothing
if (hasChildren) { if (hasChildren) {
Node root = selectedNode; Node root = selectedNode;
root.addNodeListener(dummyNodeListener);
setupTable(root);
} else {
final OutlineView ov = ((OutlineView) this.tableScrollPanel);
Node emptyNode = new AbstractNode(Children.LEAF);
em.setRootContext(emptyNode); // make empty node
ov.getOutline().setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
ov.setPropertyColumns(); // set the empty property header
}
} finally {
this.setCursor(null);
}
}
/**
* Create Column Headers based on the Content represented by the Nodes in
* the table.
*
* @param root The parent Node of the ContentNodes
*/
private void setupTable(final Node root) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
//wrap to filter out children //wrap to filter out children
//note: this breaks the tree view mode in this generic viewer, //note: this breaks the tree view mode in this generic viewer,
//so wrap nodes earlier if want 1 level view //so wrap nodes earlier if want 1 level view
@ -256,11 +291,11 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
em.setRootContext(root); em.setRootContext(root);
final OutlineView ov = ((OutlineView) this.tableScrollPanel); final OutlineView ov = ((OutlineView) DataResultViewerTable.this.tableScrollPanel);
propertiesAcc.clear(); propertiesAcc.clear();
this.getAllChildPropertyHeadersRec(selectedNode, 100); DataResultViewerTable.this.getAllChildPropertyHeadersRec(root, 100);
List<Node.Property> props = new ArrayList<Node.Property>(propertiesAcc); List<Node.Property> props = new ArrayList<Node.Property>(propertiesAcc);
if (props.size() > 0) { if (props.size() > 0) {
Node.Property prop = props.remove(0); Node.Property prop = props.remove(0);
@ -310,7 +345,7 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
// get first 100 rows values for the table // get first 100 rows values for the table
Object[][] content = null; Object[][] content = null;
content = getRowValues(selectedNode, 100); content = getRowValues(root, 100);
if (content != null) { if (content != null) {
@ -336,17 +371,8 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
// turn on the auto resize // turn on the auto resize
ov.getOutline().setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); ov.getOutline().setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
} }
} else {
final OutlineView ov = ((OutlineView) this.tableScrollPanel);
Node emptyNode = new AbstractNode(Children.LEAF);
em.setRootContext(emptyNode); // make empty node
ov.getOutline().setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
ov.setPropertyColumns(); // set the empty property header
} }
} finally { });
this.setCursor(null);
}
} }
private static Object[][] getRowValues(Node node, int rows) { private static Object[][] getRowValues(Node node, int rows) {
@ -449,4 +475,36 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
super.clearComponent(); super.clearComponent();
} }
private class DummyNodeListener implements NodeListener {
private static final String DUMMY_NODE_DISPLAY_NAME = "Please Wait...";
@Override
public void childrenAdded(NodeMemberEvent nme) {
Node added = nme.getNode();
if (added.getDisplayName().equals(DUMMY_NODE_DISPLAY_NAME)) {
// If it's the dummy waiting node, we don't want
// to reload the table headers
return;
}
setupTable(added);
}
@Override
public void childrenRemoved(NodeMemberEvent nme) {
}
@Override
public void childrenReordered(NodeReorderEvent nre) {
}
@Override
public void nodeDestroyed(NodeEvent ne) {
}
@Override
public void propertyChange(PropertyChangeEvent evt) {
}
}
} }

View File

@ -343,15 +343,6 @@ public class FXVideoPanel extends MediaViewVideoPanel {
private static final String STOP_TEXT = "X"; private static final String STOP_TEXT = "X";
/** CSS-formatted skin for pauseButton when showing PLAY_TEXT. **/
private static final String PLAY_STYLE = "-fx-text-fill: green;";
/** CSS-formatted skin for pauseButton when showing PAUSE_TEXT. **/
private static final String PAUSE_STYLE = "-fx-font-weight: bolder;";
/** CSS-formatted skin for stopButton. **/
private static final String STOP_STYLE = "-fx-text-fill: red; -fx-font-weight: bold;";
public MediaPane() { public MediaPane() {
// Video Display // Video Display
mediaViewPane = new HBox(); mediaViewPane = new HBox();
@ -368,9 +359,7 @@ public class FXVideoPanel extends MediaViewVideoPanel {
mediaTools.setPadding(new Insets(5, 10, 5, 10)); mediaTools.setPadding(new Insets(5, 10, 5, 10));
pauseButton = new Button(PLAY_TEXT); pauseButton = new Button(PLAY_TEXT);
pauseButton.setStyle(PLAY_STYLE);
stopButton = new Button(STOP_TEXT); stopButton = new Button(STOP_TEXT);
stopButton.setStyle(STOP_STYLE);
mediaTools.getChildren().add(pauseButton); mediaTools.getChildren().add(pauseButton);
mediaTools.getChildren().add(new Label(" ")); mediaTools.getChildren().add(new Label(" "));
mediaTools.getChildren().add(stopButton); mediaTools.getChildren().add(stopButton);
@ -670,7 +659,6 @@ public class FXVideoPanel extends MediaViewVideoPanel {
@Override @Override
public void run() { public void run() {
pauseButton.setText(PLAY_TEXT); pauseButton.setText(PLAY_TEXT);
pauseButton.setStyle(PLAY_STYLE);
} }
} }
@ -681,7 +669,6 @@ public class FXVideoPanel extends MediaViewVideoPanel {
@Override @Override
public void run() { public void run() {
pauseButton.setText(PAUSE_TEXT); pauseButton.setText(PAUSE_TEXT);
pauseButton.setStyle(PAUSE_STYLE);
} }
} }
} }

View File

@ -46,7 +46,7 @@ import org.sleuthkit.datamodel.VirtualDirectory;
public final class ContentUtils { public final class ContentUtils {
private final static Logger logger = Logger.getLogger(ContentUtils.class.getName()); private final static Logger logger = Logger.getLogger(ContentUtils.class.getName());
private static final SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private static final SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
private static final SimpleDateFormat dateFormatterISO8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); private static final SimpleDateFormat dateFormatterISO8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
// don't instantiate // don't instantiate
@ -105,12 +105,17 @@ public final class ContentUtils {
public static TimeZone getTimeZone(Content c) { public static TimeZone getTimeZone(Content c) {
try { try {
final Image image = c.getImage(); if (false) {
if (image != null) { return TimeZone.getTimeZone("GMT");
return TimeZone.getTimeZone(image.getTimeZone()); }
} else { else {
//case such as top level VirtualDirectory final Image image = c.getImage();
return TimeZone.getDefault(); if (image != null) {
return TimeZone.getTimeZone(image.getTimeZone());
} else {
//case such as top level VirtualDirectory
return TimeZone.getDefault();
}
} }
} catch (TskException ex) { } catch (TskException ex) {
return TimeZone.getDefault(); return TimeZone.getDefault();

View File

@ -22,6 +22,8 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import org.openide.nodes.AbstractNode; import org.openide.nodes.AbstractNode;
import org.openide.nodes.ChildFactory; import org.openide.nodes.ChildFactory;
import org.openide.nodes.Children; import org.openide.nodes.Children;
@ -213,6 +215,8 @@ public class DeletedContent implements AutopsyVisitableItem {
private SleuthkitCase skCase; private SleuthkitCase skCase;
private DeletedContent.DeletedContentFilter filter; private DeletedContent.DeletedContentFilter filter;
private final Logger logger = Logger.getLogger(DeletedContentChildren.class.getName()); private final Logger logger = Logger.getLogger(DeletedContentChildren.class.getName());
private static final int MAX_OBJECTS = 2001;
DeletedContentChildren(DeletedContent.DeletedContentFilter filter, SleuthkitCase skCase) { DeletedContentChildren(DeletedContent.DeletedContentFilter filter, SleuthkitCase skCase) {
this.skCase = skCase; this.skCase = skCase;
@ -221,7 +225,20 @@ public class DeletedContent implements AutopsyVisitableItem {
@Override @Override
protected boolean createKeys(List<AbstractFile> list) { protected boolean createKeys(List<AbstractFile> list) {
list.addAll(runFsQuery()); List<AbstractFile> queryList = runFsQuery();
if (queryList.size() == MAX_OBJECTS) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
JOptionPane.showMessageDialog(null, "There are more Deleted Files than can be displayed. Only the first "
+ (MAX_OBJECTS - 1)
+ " Deleted Files will be shown.");
}
});
}
queryList.remove(queryList.size() - 1);
list.addAll(queryList);
return true; return true;
} }
@ -258,6 +275,7 @@ public class DeletedContent implements AutopsyVisitableItem {
} }
query += " LIMIT " + MAX_OBJECTS;
return query; return query;
} }

View File

@ -57,7 +57,6 @@ class FileTypeChildren extends ChildFactory<Content> {
list.addAll(runQuery()); list.addAll(runQuery());
return true; return true;
} }
private String createQuery(){ private String createQuery(){
String query = "(dir_type = " + TskData.TSK_FS_NAME_TYPE_ENUM.REG.getValue() + ")" String query = "(dir_type = " + TskData.TSK_FS_NAME_TYPE_ENUM.REG.getValue() + ")"
@ -66,7 +65,7 @@ class FileTypeChildren extends ChildFactory<Content> {
query += " OR name LIKE '%" + s + "'"; query += " OR name LIKE '%" + s + "'";
} }
query += ')'; query += ')';
//query += " LIMIT " + MAX_OBJECTS; // query += " LIMIT " + MAX_OBJECTS;
return query; return query;
} }
@ -74,10 +73,7 @@ class FileTypeChildren extends ChildFactory<Content> {
private List<AbstractFile> runQuery(){ private List<AbstractFile> runQuery(){
List<AbstractFile> list = new ArrayList<>(); List<AbstractFile> list = new ArrayList<>();
try { try {
List<AbstractFile> res = skCase.findAllFilesWhere(createQuery()); list = skCase.findAllFilesWhere(createQuery());
for(AbstractFile c : res){
list.add(c);
}
} catch (TskCoreException ex) { } catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Couldn't get search results", ex); logger.log(Level.SEVERE, "Couldn't get search results", ex);
} }

View File

@ -1,383 +1,383 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011 Basis Technology Corp. * Copyright 2011 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.sleuthkit.autopsy.directorytree; package org.sleuthkit.autopsy.directorytree;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Font; import java.awt.Font;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.table.DefaultTableModel; import javax.swing.table.DefaultTableModel;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.ContentVisitor; import org.sleuthkit.datamodel.ContentVisitor;
import org.sleuthkit.datamodel.DerivedFile; import org.sleuthkit.datamodel.DerivedFile;
import org.sleuthkit.datamodel.Directory; import org.sleuthkit.datamodel.Directory;
import org.sleuthkit.datamodel.FileSystem; import org.sleuthkit.datamodel.FileSystem;
import org.sleuthkit.datamodel.Image; import org.sleuthkit.datamodel.Image;
import org.sleuthkit.datamodel.LocalFile; import org.sleuthkit.datamodel.LocalFile;
import org.sleuthkit.datamodel.VirtualDirectory; import org.sleuthkit.datamodel.VirtualDirectory;
import org.sleuthkit.datamodel.Volume; import org.sleuthkit.datamodel.Volume;
public class ExplorerNodeActionVisitor extends ContentVisitor.Default<List<? extends Action>> { public class ExplorerNodeActionVisitor extends ContentVisitor.Default<List<? extends Action>> {
private static ExplorerNodeActionVisitor instance = new ExplorerNodeActionVisitor(); private static ExplorerNodeActionVisitor instance = new ExplorerNodeActionVisitor();
public static List<Action> getActions(Content c) { public static List<Action> getActions(Content c) {
List<Action> actions = new ArrayList<Action>(); List<Action> actions = new ArrayList<Action>();
actions.addAll(c.accept(instance)); actions.addAll(c.accept(instance));
//TODO: fix this //TODO: fix this
/* /*
while (c.isOnto()) { while (c.isOnto()) {
try { try {
List<? extends Content> children = c.getChildren(); List<? extends Content> children = c.getChildren();
if (!children.isEmpty()) { if (!children.isEmpty()) {
c = c.getChildren().get(0); c = c.getChildren().get(0);
} else { } else {
return actions; return actions;
} }
} catch (TskException ex) { } catch (TskException ex) {
Log.get(ExplorerNodeActionVisitor.class).log(Level.WARNING, "Error getting show detail actions.", ex); Log.get(ExplorerNodeActionVisitor.class).log(Level.WARNING, "Error getting show detail actions.", ex);
return actions; return actions;
} }
actions.addAll(c.accept(instance)); actions.addAll(c.accept(instance));
}*/ }*/
return actions; return actions;
} }
ExplorerNodeActionVisitor() { ExplorerNodeActionVisitor() {
} }
@Override @Override
public List<? extends Action> visit(final Image img) { public List<? extends Action> visit(final Image img) {
List<Action> lst = new ArrayList<Action>(); List<Action> lst = new ArrayList<Action>();
lst.add(new ImageDetails("Image Details", img)); lst.add(new ImageDetails("Image Details", img));
//TODO lst.add(new ExtractAction("Extract Image", img)); //TODO lst.add(new ExtractAction("Extract Image", img));
lst.add(new ExtractUnallocAction("Extract Unallocated Space to Single Files", img)); lst.add(new ExtractUnallocAction("Extract Unallocated Space to Single Files", img));
return lst; return lst;
} }
@Override @Override
public List<? extends Action> visit(final FileSystem fs) { public List<? extends Action> visit(final FileSystem fs) {
return Collections.singletonList(new FileSystemDetails("File System Details", fs)); return Collections.singletonList(new FileSystemDetails("File System Details", fs));
} }
@Override @Override
public List<? extends Action> visit(final Volume vol) { public List<? extends Action> visit(final Volume vol) {
List<AbstractAction> lst = new ArrayList<AbstractAction>(); List<AbstractAction> lst = new ArrayList<AbstractAction>();
lst.add(new VolumeDetails("Volume Details", vol)); lst.add(new VolumeDetails("Volume Details", vol));
lst.add(new ExtractUnallocAction("Extract Unallocated Space to Single File", vol)); lst.add(new ExtractUnallocAction("Extract Unallocated Space to Single File", vol));
return lst; return lst;
} }
@Override @Override
public List<? extends Action> visit(final Directory d) { public List<? extends Action> visit(final Directory d) {
List<Action> actions = new ArrayList<Action>(); List<Action> actions = new ArrayList<Action>();
actions.add(TagAbstractFileAction.getInstance()); actions.add(TagAbstractFileAction.getInstance());
return actions; return actions;
} }
@Override @Override
public List<? extends Action> visit(final VirtualDirectory d) { public List<? extends Action> visit(final VirtualDirectory d) {
List<Action> actions = new ArrayList<Action>(); List<Action> actions = new ArrayList<Action>();
actions.add(ExtractAction.getInstance()); actions.add(ExtractAction.getInstance());
actions.add(TagAbstractFileAction.getInstance()); actions.add(TagAbstractFileAction.getInstance());
return actions; return actions;
} }
@Override @Override
public List<? extends Action> visit(final DerivedFile d) { public List<? extends Action> visit(final DerivedFile d) {
List<Action> actions = new ArrayList<Action>(); List<Action> actions = new ArrayList<Action>();
actions.add(ExtractAction.getInstance()); actions.add(ExtractAction.getInstance());
actions.add(TagAbstractFileAction.getInstance()); actions.add(TagAbstractFileAction.getInstance());
return actions; return actions;
} }
@Override @Override
public List<? extends Action> visit(final LocalFile d) { public List<? extends Action> visit(final LocalFile d) {
List<Action> actions = new ArrayList<Action>(); List<Action> actions = new ArrayList<Action>();
actions.add(ExtractAction.getInstance()); actions.add(ExtractAction.getInstance());
actions.add(TagAbstractFileAction.getInstance()); actions.add(TagAbstractFileAction.getInstance());
return actions; return actions;
} }
@Override @Override
public List<? extends Action> visit(final org.sleuthkit.datamodel.File d) { public List<? extends Action> visit(final org.sleuthkit.datamodel.File d) {
List<Action> actions = new ArrayList<Action>(); List<Action> actions = new ArrayList<Action>();
actions.add(ExtractAction.getInstance()); actions.add(ExtractAction.getInstance());
actions.add(TagAbstractFileAction.getInstance()); actions.add(TagAbstractFileAction.getInstance());
return actions; return actions;
} }
@Override @Override
protected List<? extends Action> defaultVisit(Content di) { protected List<? extends Action> defaultVisit(Content di) {
return Collections.<Action>emptyList(); return Collections.<Action>emptyList();
} }
//Below here are classes regarding node-specific actions //Below here are classes regarding node-specific actions
/** /**
* VolumeDetails class * VolumeDetails class
*/ */
private class VolumeDetails extends AbstractAction { private class VolumeDetails extends AbstractAction {
private final String title; private final String title;
private final Volume vol; private final Volume vol;
VolumeDetails(String title, Volume vol) { VolumeDetails(String title, Volume vol) {
super(title); super(title);
this.title = title; this.title = title;
this.vol = vol; this.vol = vol;
} }
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
Logger.noteAction(ExplorerNodeActionVisitor.class); Logger.noteAction(ExplorerNodeActionVisitor.class);
final JFrame frame = new JFrame(title); final JFrame frame = new JFrame(title);
final JDialog popUpWindow = new JDialog(frame, title, true); // to make the popUp Window to be modal final JDialog popUpWindow = new JDialog(frame, title, true); // to make the popUp Window to be modal
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
// set the popUp window / JFrame // set the popUp window / JFrame
popUpWindow.setSize(800, 400); popUpWindow.setSize(800, 400);
int w = popUpWindow.getSize().width; int w = popUpWindow.getSize().width;
int h = popUpWindow.getSize().height; int h = popUpWindow.getSize().height;
// set the location of the popUp Window on the center of the screen // set the location of the popUp Window on the center of the screen
popUpWindow.setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2); popUpWindow.setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
VolumeDetailsPanel volumeDetailPanel = new VolumeDetailsPanel(); VolumeDetailsPanel volumeDetailPanel = new VolumeDetailsPanel();
Boolean counter = false; Boolean counter = false;
volumeDetailPanel.setVolumeIDValue(Long.toString(vol.getAddr())); volumeDetailPanel.setVolumeIDValue(Long.toString(vol.getAddr()));
volumeDetailPanel.setStartValue(Long.toString(vol.getStart())); volumeDetailPanel.setStartValue(Long.toString(vol.getStart()));
volumeDetailPanel.setLengthValue(Long.toString(vol.getLength())); volumeDetailPanel.setLengthValue(Long.toString(vol.getLength()));
volumeDetailPanel.setDescValue(vol.getDescription()); volumeDetailPanel.setDescValue(vol.getDescription());
volumeDetailPanel.setFlagsValue(vol.getFlagsAsString()); volumeDetailPanel.setFlagsValue(vol.getFlagsAsString());
counter = true; counter = true;
if (counter) { if (counter) {
// add the volume detail panel to the popUp window // add the volume detail panel to the popUp window
popUpWindow.add(volumeDetailPanel); popUpWindow.add(volumeDetailPanel);
} else { } else {
// error handler if no volume matches // error handler if no volume matches
JLabel error = new JLabel("Error: No Volume Matches."); JLabel error = new JLabel("Error: No Volume Matches.");
error.setFont(new Font("Arial", Font.BOLD, 24)); error.setFont(new Font("Arial", Font.BOLD, 24));
popUpWindow.add(error); popUpWindow.add(error);
} }
// add the command to close the window to the button on the Volume Detail Panel // add the command to close the window to the button on the Volume Detail Panel
volumeDetailPanel.setOKButtonActionListener(new ActionListener() { volumeDetailPanel.setOKButtonActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
popUpWindow.dispose(); popUpWindow.dispose();
} }
}); });
popUpWindow.pack(); popUpWindow.pack();
popUpWindow.setResizable(false); popUpWindow.setResizable(false);
popUpWindow.setVisible(true); popUpWindow.setVisible(true);
} }
} }
/** /**
* ImageDetails panel class * ImageDetails panel class
*/ */
private class ImageDetails extends AbstractAction { private class ImageDetails extends AbstractAction {
final String title; final String title;
final Image img; final Image img;
ImageDetails(String title, Image img) { ImageDetails(String title, Image img) {
super(title); super(title);
this.title = title; this.title = title;
this.img = img; this.img = img;
} }
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
Logger.noteAction(ExplorerNodeActionVisitor.class); Logger.noteAction(ExplorerNodeActionVisitor.class);
final JFrame frame = new JFrame(title); final JFrame frame = new JFrame(title);
final JDialog popUpWindow = new JDialog(frame, title, true); // to make the popUp Window to be modal final JDialog popUpWindow = new JDialog(frame, title, true); // to make the popUp Window to be modal
// if we select the Image Details menu // if we select the Image Details menu
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
// set the popUp window / JFrame // set the popUp window / JFrame
popUpWindow.setSize(750, 400); popUpWindow.setSize(750, 400);
int w = popUpWindow.getSize().width; int w = popUpWindow.getSize().width;
int h = popUpWindow.getSize().height; int h = popUpWindow.getSize().height;
// set the location of the popUp Window on the center of the screen // set the location of the popUp Window on the center of the screen
popUpWindow.setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2); popUpWindow.setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
ImageDetailsPanel imgDetailPanel = new ImageDetailsPanel(); ImageDetailsPanel imgDetailPanel = new ImageDetailsPanel();
Boolean counter = false; Boolean counter = false;
imgDetailPanel.setImgNameValue(img.getName()); imgDetailPanel.setImgNameValue(img.getName());
imgDetailPanel.setImgTypeValue(Image.imageTypeToString(img.getType())); imgDetailPanel.setImgTypeValue(img.getType().getName());
imgDetailPanel.setImgSectorSizeValue(Long.toString(img.getSsize())); imgDetailPanel.setImgSectorSizeValue(Long.toString(img.getSsize()));
counter = true; counter = true;
if (counter) { if (counter) {
// add the volume detail panel to the popUp window // add the volume detail panel to the popUp window
popUpWindow.add(imgDetailPanel); popUpWindow.add(imgDetailPanel);
} else { } else {
// error handler if no volume matches // error handler if no volume matches
JLabel error = new JLabel("Error: No Volume Matches."); JLabel error = new JLabel("Error: No Volume Matches.");
error.setFont(new Font("Arial", Font.BOLD, 24)); error.setFont(new Font("Arial", Font.BOLD, 24));
popUpWindow.add(error); popUpWindow.add(error);
} }
// add the command to close the window to the button on the Volume Detail Panel // add the command to close the window to the button on the Volume Detail Panel
imgDetailPanel.setOKButtonActionListener(new ActionListener() { imgDetailPanel.setOKButtonActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
popUpWindow.dispose(); popUpWindow.dispose();
} }
}); });
popUpWindow.pack(); popUpWindow.pack();
popUpWindow.setResizable(false); popUpWindow.setResizable(false);
popUpWindow.setVisible(true); popUpWindow.setVisible(true);
} }
} }
/** /**
* FileSystemDetails class * FileSystemDetails class
*/ */
private class FileSystemDetails extends AbstractAction { private class FileSystemDetails extends AbstractAction {
private final FileSystem fs; private final FileSystem fs;
private final String title; private final String title;
FileSystemDetails(String title, FileSystem fs) { FileSystemDetails(String title, FileSystem fs) {
super(title); super(title);
this.title = title; this.title = title;
this.fs = fs; this.fs = fs;
} }
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
Logger.noteAction(ExplorerNodeActionVisitor.class); Logger.noteAction(ExplorerNodeActionVisitor.class);
final JFrame frame = new JFrame(title); final JFrame frame = new JFrame(title);
final JDialog popUpWindow = new JDialog(frame, title, true); // to make the popUp Window to be modal final JDialog popUpWindow = new JDialog(frame, title, true); // to make the popUp Window to be modal
// set the popUp window / JFrame // set the popUp window / JFrame
popUpWindow.setSize(1000, 500); popUpWindow.setSize(1000, 500);
int w = popUpWindow.getSize().width; int w = popUpWindow.getSize().width;
int h = popUpWindow.getSize().height; int h = popUpWindow.getSize().height;
// set the location of the popUp Window on the center of the screen // set the location of the popUp Window on the center of the screen
popUpWindow.setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2); popUpWindow.setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
String[] columnNames = new String[]{ String[] columnNames = new String[]{
"fs_id", "fs_id",
"img_offset", "img_offset",
"par_id", "par_id",
"fs_type", "fs_type",
"block_size", "block_size",
"block_count", "block_count",
"root_inum", "root_inum",
"first_inum", "first_inum",
"last_inum" "last_inum"
}; };
Object[][] rowValues = new Object[1][9]; Object[][] rowValues = new Object[1][9];
Content parent = null; Content parent = null;
try { try {
parent = fs.getParent(); parent = fs.getParent();
} catch (Exception ex) { } catch (Exception ex) {
throw new RuntimeException("Problem getting parent from " + FileSystem.class.getName() + ": " + fs, ex); throw new RuntimeException("Problem getting parent from " + FileSystem.class.getName() + ": " + fs, ex);
} }
long id = -1; long id = -1;
if (parent != null) { if (parent != null) {
id = parent.getId(); id = parent.getId();
} }
Arrays.fill(rowValues, 0, 1, new Object[]{ Arrays.fill(rowValues, 0, 1, new Object[]{
fs.getId(), fs.getId(),
fs.getImageOffset(), fs.getImageOffset(),
id, id,
fs.getFsType(), fs.getFsType(),
fs.getBlock_size(), fs.getBlock_size(),
fs.getBlock_count(), fs.getBlock_count(),
fs.getRoot_inum(), fs.getRoot_inum(),
fs.getFirst_inum(), fs.getFirst_inum(),
fs.getLastInum() fs.getLastInum()
}); });
JTable table = new JTable(new DefaultTableModel(rowValues, columnNames)); JTable table = new JTable(new DefaultTableModel(rowValues, columnNames));
FileSystemDetailsPanel fsdPanel = new FileSystemDetailsPanel(); FileSystemDetailsPanel fsdPanel = new FileSystemDetailsPanel();
// add the command to close the window to the button on the Volume Detail Panel // add the command to close the window to the button on the Volume Detail Panel
fsdPanel.setOKButtonActionListener(new ActionListener() { fsdPanel.setOKButtonActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
popUpWindow.dispose(); popUpWindow.dispose();
} }
}); });
try { try {
fsdPanel.setFileSystemTypeValue(table.getValueAt(0, 3).toString()); fsdPanel.setFileSystemTypeValue(table.getValueAt(0, 3).toString());
fsdPanel.setImageOffsetValue(table.getValueAt(0, 1).toString()); fsdPanel.setImageOffsetValue(table.getValueAt(0, 1).toString());
fsdPanel.setVolumeIDValue(table.getValueAt(0, 2).toString()); //TODO: fix this to parent id, not vol id fsdPanel.setVolumeIDValue(table.getValueAt(0, 2).toString()); //TODO: fix this to parent id, not vol id
fsdPanel.setBlockSizeValue(table.getValueAt(0, 4).toString()); fsdPanel.setBlockSizeValue(table.getValueAt(0, 4).toString());
fsdPanel.setBlockCountValue(table.getValueAt(0, 5).toString()); fsdPanel.setBlockCountValue(table.getValueAt(0, 5).toString());
fsdPanel.setRootInumValue(table.getValueAt(0, 6).toString()); fsdPanel.setRootInumValue(table.getValueAt(0, 6).toString());
fsdPanel.setFirstInumValue(table.getValueAt(0, 7).toString()); fsdPanel.setFirstInumValue(table.getValueAt(0, 7).toString());
fsdPanel.setLastInumValue(table.getValueAt(0, 8).toString()); fsdPanel.setLastInumValue(table.getValueAt(0, 8).toString());
popUpWindow.add(fsdPanel); popUpWindow.add(fsdPanel);
} catch (Exception ex) { } catch (Exception ex) {
Logger.getLogger(ExplorerNodeActionVisitor.class.getName()).log(Level.WARNING, "Error setting up File System Details panel.", ex); Logger.getLogger(ExplorerNodeActionVisitor.class.getName()).log(Level.WARNING, "Error setting up File System Details panel.", ex);
} }
popUpWindow.pack(); popUpWindow.pack();
popUpWindow.setResizable(false); popUpWindow.setResizable(false);
popUpWindow.setVisible(true); popUpWindow.setVisible(true);
} }
} }
} }

View File

@ -27,6 +27,17 @@
<condition property="jre.home.64"> <condition property="jre.home.64">
<isset property="env.JRE_HOME_64"/> <isset property="env.JRE_HOME_64"/>
</condition> </condition>
<!-- Update configuration file to include jre -->
<property name="inst.property.file" value="${inst-path}/etc/${app.name}.conf" />
<property name="jvm.options" value="&quot;--branding ${app.name} -J-Xms24m -J-Xmx512m -J-XX:MaxPermSize=128M -J-Xverify:none -J-Xdock:name=${app.title}&quot;" />
<propertyfile file="${inst.property.file}">
<!-- Note: can be higher on 64 bit systems, should be in sync with project.properties -->
<entry key="default_options" value="@JVM_OPTIONS" />
<entry key="jdkhome" value="&quot;jre7&quot;" />
</propertyfile>
<!-- workaround for ant escaping : and = when setting properties -->
<replace file="${inst.property.file}" token="@JVM_OPTIONS" value="${jvm.options}" />
</target> </target>
<target name="autoAIPath" description="Attempt to find the AI path based on standard installation location"> <target name="autoAIPath" description="Attempt to find the AI path based on standard installation location">
@ -72,6 +83,10 @@
<var name="aut-bin-name" value="${app.name}.exe"/> <var name="aut-bin-name" value="${app.name}.exe"/>
<var name="jre-path" value="${env.JRE_HOME_32}"/> <var name="jre-path" value="${env.JRE_HOME_32}"/>
<var name="package-type" value="x86" /> <var name="package-type" value="x86" />
<var name="jvm.max.mem" value="512" />
<exec executable="${ai-exe-path}">
<arg line="/edit ${aip-path} /SetAppdir -buildname DefaultBuild -path [ProgramFilesFolder][ProductName]-${app.version}"/>
</exec>
<antcall target="run-ai-32" inheritAll="true" inheritRefs="true" /> <antcall target="run-ai-32" inheritAll="true" inheritRefs="true" />
<delete dir="${nbdist.dir}/installer_${app.name}_32-cache"/> <delete dir="${nbdist.dir}/installer_${app.name}_32-cache"/>
<move file="${nbdist.dir}/installer_${app.name}_32-SetupFiles/installer_${app.name}_32.msi" tofile="${nbdist.dir}/${app.name}-${app.version}-32bit.msi" /> <move file="${nbdist.dir}/installer_${app.name}_32-SetupFiles/installer_${app.name}_32.msi" tofile="${nbdist.dir}/${app.name}-${app.version}-32bit.msi" />
@ -86,7 +101,11 @@
<var name="aut-bin-name" value="${app.name}64.exe"/> <var name="aut-bin-name" value="${app.name}64.exe"/>
<var name="jre-path" value="${env.JRE_HOME_64}"/> <var name="jre-path" value="${env.JRE_HOME_64}"/>
<var name="package-type" value="x64" /> <var name="package-type" value="x64" />
<var name="jvm.max.mem" value="2048"/>
<echo message="aip-path: ${aip-path}" /> <echo message="aip-path: ${aip-path}" />
<exec executable="${ai-exe-path}">
<arg line="/edit ${aip-path} /SetAppdir -buildname DefaultBuild -path [ProgramFiles64Folder][ProductName]-${app.version}"/>
</exec>
<antcall target="run-ai-64" inheritAll="true" inheritRefs="true" /> <antcall target="run-ai-64" inheritAll="true" inheritRefs="true" />
<delete dir="${nbdist.dir}/installer_${app.name}_64-cache"/> <delete dir="${nbdist.dir}/installer_${app.name}_64-cache"/>
<move file="${nbdist.dir}/installer_${app.name}_64-SetupFiles/installer_${app.name}_64.msi" tofile="${nbdist.dir}/${app.name}-${app.version}-64bit.msi" /> <move file="${nbdist.dir}/installer_${app.name}_64-SetupFiles/installer_${app.name}_64.msi" tofile="${nbdist.dir}/${app.name}-${app.version}-64bit.msi" />
@ -118,7 +137,22 @@
replace="ProductVersion&quot; Value=&quot;${app.version}" /> replace="ProductVersion&quot; Value=&quot;${app.version}" />
</target> </target>
<target name="add-ai-files" description="Add the files in the installation path to the installer file"> <target name="update-config" description="Updates configuration file with correct JVM args.">
<!-- Update configuration file to include jre -->
<property name="inst.property.file" value="${inst-path}/etc/${app.name}.conf" />
<!-- Sets max heap size to be ${jvm.max.mem} which is set in the run-ai-(32/64) target -->
<var name="jvm.args" value="&quot;--branding ${app.name} -J-Xms24m -J-Xmx${jvm.max.mem}m -J-XX:MaxPermSize=128M -J-Xverify:none -J-Xdock:name=${app.title}&quot;" />
<propertyfile file="${inst.property.file}">
<!-- Note: can be higher on 64 bit systems, should be in sync with project.properties -->
<entry key="default_options" value="@JVM_OPTIONS" />
<entry key="jdkhome" value="&quot;jre7&quot;" />
</propertyfile>
<!-- workaround for ant escaping : and = when setting properties -->
<replace file="${inst.property.file}" token="@JVM_OPTIONS" value="${jvm.args}" />
</target>
<target name="add-ai-files" depends="update-config" description="Add the files in the installation path to the installer file">
<foreach target="add-file-or-dir" param="theFile" inheritall="true" inheritrefs="true"> <foreach target="add-file-or-dir" param="theFile" inheritall="true" inheritrefs="true">
<path> <path>
<fileset dir="${inst-path}"> <fileset dir="${inst-path}">
@ -136,7 +170,6 @@
</target> </target>
<target name="add-file-or-dir" depends="is-file-or-folder"> <target name="add-file-or-dir" depends="is-file-or-folder">
<echo message="${ai-exe-path}" />
<echo message="Adding ${file-or-folder} to installer: ${theFile}"/> <echo message="Adding ${file-or-folder} to installer: ${theFile}"/>
<exec executable="${ai-exe-path}"> <exec executable="${ai-exe-path}">
<arg line="/edit ${aip-path} /Add${file-or-folder} APPDIR ${theFile}" /> <arg line="/edit ${aip-path} /Add${file-or-folder} APPDIR ${theFile}" />
@ -174,7 +207,7 @@
<arg line="/edit ${aip-path} /NewEnvironment -name GSTREAMER_PATH -value [APPDIR]gstreamer\bin -install_operation CreateUpdate -behavior Append -system_variable"/> <arg line="/edit ${aip-path} /NewEnvironment -name GSTREAMER_PATH -value [APPDIR]gstreamer\bin -install_operation CreateUpdate -behavior Append -system_variable"/>
</exec> </exec>
<exec executable="${ai-exe-path}"> <exec executable="${ai-exe-path}">
<arg line="/edit ${aip-path} /NewEnvironment -name GSTREAMER_PATH -value [APPDIR]gstreamer\lib\gstreamer-0.10 -install_operation CreateUpdate -behavior Append -system_variable"/> <arg line="/edit ${aip-path} /NewEnvironment -name GSTREAMER_PATH -value [APPDIR]gstreamer\lib -install_operation CreateUpdate -behavior Append -system_variable"/>
</exec> </exec>
<exec executable="${ai-exe-path}"> <exec executable="${ai-exe-path}">
<arg line="/edit ${aip-path} /NewEnvironment -name PATH -value %GSTREAMER_PATH% -install_operation CreateUpdate -behavior Append -system_variable"/> <arg line="/edit ${aip-path} /NewEnvironment -name PATH -value %GSTREAMER_PATH% -install_operation CreateUpdate -behavior Append -system_variable"/>

View File

@ -78,7 +78,6 @@
<propertyfile file="${app.property.file}"> <propertyfile file="${app.property.file}">
<!-- Note: can be higher on 64 bit systems, should be in sync with project.properties --> <!-- Note: can be higher on 64 bit systems, should be in sync with project.properties -->
<entry key="default_options" value="@JVM_OPTIONS" /> <entry key="default_options" value="@JVM_OPTIONS" />
<entry key="jdkhome" value="&quot;jre7&quot;" />
</propertyfile> </propertyfile>
<!-- workaround for ant escaping : and = when setting properties --> <!-- workaround for ant escaping : and = when setting properties -->
<replace file="${app.property.file}" token="@JVM_OPTIONS" value="${jvm.options}" /> <replace file="${app.property.file}" token="@JVM_OPTIONS" value="${jvm.options}" />

View File

@ -12,7 +12,7 @@ build.type=DEVELOPMENT
update_versions=false update_versions=false
#custom JVM options #custom JVM options
#Note: can be higher on 64 bit systems, should be in sync with build.xml #Note: can be higher on 64 bit systems, should be in sync with build.xml
run.args.extra=-J-Xms24m -J-Xmx512m -J-XX:MaxPermSize=128M -J-Xverify:none run.args.extra=-J-Xms24m -J-Xmx2048m -J-XX:MaxPermSize=128M -J-Xverify:none
auxiliary.org-netbeans-modules-apisupport-installer.license-type=apache.v2 auxiliary.org-netbeans-modules-apisupport-installer.license-type=apache.v2
auxiliary.org-netbeans-modules-apisupport-installer.os-linux=false auxiliary.org-netbeans-modules-apisupport-installer.os-linux=false
auxiliary.org-netbeans-modules-apisupport-installer.os-macosx=false auxiliary.org-netbeans-modules-apisupport-installer.os-macosx=false