diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/directorytree/Bundle.properties-MERGED index f3efd92a72..1fe95f35b6 100755 --- a/Core/src/org/sleuthkit/autopsy/directorytree/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/directorytree/Bundle.properties-MERGED @@ -5,6 +5,7 @@ DirectoryTreeTopComponent.componentOpened.groupDataSources.text=This case contai DirectoryTreeTopComponent.componentOpened.groupDataSources.title=Group by data source? DirectoryTreeTopComponent.emptyMimeNode.text=Data not available. Run file type identification module. DirectoryTreeTopComponent.resultsView.title=Listing +ExternalViewerAction.actionPerformed.failure.exe.message=The file is an executable and will not be opened. ExternalViewerAction.actionPerformed.failure.IO.message=There is no associated editor for files of this type or the associated application failed to launch. ExternalViewerAction.actionPerformed.failure.missingFile.message=The file no longer exists. ExternalViewerAction.actionPerformed.failure.open.url=Cannot open URL diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java index 83faae64eb..6ff52e25d2 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2018 Basis Technology Corp. + * Copyright 2011-2019 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -48,6 +48,7 @@ public class ExternalViewerAction extends AbstractAction { private final AbstractFile fileObject; private String fileObjectExt; final static String[] EXECUTABLE_EXT = {".exe", ".dll", ".com", ".bat", ".msi", ".reg", ".scr", ".cmd"}; //NON-NLS + private boolean isExecutable; ExternalViewerAction(String title, AbstractFile file, boolean isSlackFile) { super(title); @@ -90,7 +91,19 @@ public class ExternalViewerAction extends AbstractAction { } @Override + @Messages({ + "# {0} - file name", + "ExternalViewerAction.actionPerformed.failure.title=Open File Failure {0}", + "ExternalViewerAction.actionPerformed.failure.exe.message=The file is an executable and will not be opened." + }) public void actionPerformed(ActionEvent e) { + if (isExecutable) { + JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), + Bundle.ExternalViewerAction_actionPerformed_failure_IO_message(), + Bundle.ExternalViewerAction_actionPerformed_failure_title(this.fileObject.getName()), + JOptionPane.ERROR_MESSAGE); + } + // Get the temp folder path of the case Case openCase; try { @@ -129,8 +142,6 @@ public class ExternalViewerAction extends AbstractAction { * @param file the file object */ @Messages({ - "# {0} - file name", - "ExternalViewerAction.actionPerformed.failure.title=Open File Failure {0}", "ExternalViewerAction.actionPerformed.failure.IO.message=There is no associated editor for files of this type or the associated application failed to launch.", "ExternalViewerAction.actionPerformed.failure.support.message=This platform (operating system) does not support opening a file in an editor this way.", "ExternalViewerAction.actionPerformed.failure.missingFile.message=The file no longer exists.", @@ -203,7 +214,7 @@ public class ExternalViewerAction extends AbstractAction { * * @param path URL to open */ - @Messages({ + @Messages({ "ExternalViewerAction.actionPerformed.urlFailure.title=Open URL Failure"}) public static void openURL(String path) { String url_path = path.replaceAll("\\\\", "/");