19 package org.sleuthkit.autopsy.datamodel;
21 import java.awt.Component;
22 import java.util.logging.Level;
24 import org.openide.util.NbBundle;
26 import javax.swing.JOptionPane;
27 import org.openide.LifecycleManager;
28 import org.openide.modules.ModuleInstall;
29 import org.openide.util.NbBundle.Messages;
42 if (instance == null) {
53 "Installer_validate_tskLibLock_title=Error calling Sleuth Kit library",
54 "Installer_validate_tskLibLock_description=<html>Another forensics application is running that uses The Sleuth Kit.<br/>You must close that application before launching Autopsy.<br/>If that application is Cyber Triage, then you should upgrade it so that it can run at the same time as Autopsy.</html>"
57 public void validate()
throws IllegalStateException {
75 throw new OldAppLockException(
"A lock on the libtsk_jni lib is already held by an old application. " + (libLock.
getLibTskJniFile() != null ? libLock.
getLibTskJniFile().getAbsolutePath() :
""));
80 if (skVersion == null) {
81 throw new Exception(NbBundle.getMessage(
this.getClass(),
"Installer.exception.tskVerStringNull.msg"));
82 }
else if (skVersion.length() == 0) {
83 throw new Exception(NbBundle.getMessage(
this.getClass(),
"Installer.exception.taskVerStringBang.msg"));
85 logger.log(Level.CONFIG,
"Sleuth Kit Version: {0}", skVersion);
88 }
catch (Exception | UnsatisfiedLinkError e) {
91 final Component parentComponent = null;
92 final int messageType = JOptionPane.ERROR_MESSAGE;
97 if (e instanceof OldAppLockException ex) {
98 logger.log(Level.SEVERE,
"An older application already holds a lock on the libtsk_jni lib", ex);
99 message = Bundle.Installer_validate_tskLibLock_description();
100 title = Bundle.Installer_validate_tskLibLock_title();
102 logger.log(Level.SEVERE,
"Error calling Sleuth Kit library (test call failed)", e);
103 logger.log(Level.SEVERE,
"Is Autopsy or Cyber Triage already running?)", e);
104 message = NbBundle.getMessage(this.getClass(),
"Installer.tskLibErr.msg", e.toString());
105 title = NbBundle.getMessage(this.getClass(),
"Installer.tskLibErr.err");
108 JOptionPane.showMessageDialog(
115 LifecycleManager.getDefault().exit();
124 }
catch (Exception ex) {
126 logger.log(Level.WARNING,
"There was an error removing the TSK lib lock.", ex);
134 }
catch (Exception ex) {
136 logger.log(Level.WARNING,
"There was an error removing the TSK lib lock.", ex);
146 static class OldAppLockException
extends Exception {
148 public OldAppLockException(String message) {
static void removeLibLock()
static synchronized Installer getDefault()
static LibraryLock acquireLibLock()
synchronized static Logger getLogger(String name)
static String getVersion()
static Installer instance