19 package org.sleuthkit.autopsy.centralrepository.eventlisteners;
21 import java.lang.reflect.InvocationTargetException;
23 import java.util.logging.Level;
24 import javax.swing.JOptionPane;
25 import javax.swing.SwingUtilities;
26 import org.openide.modules.ModuleInstall;
27 import org.openide.util.NbBundle;
28 import org.openide.windows.WindowManager;
60 if (instance == null) {
85 "Installer.initialCreateSqlite.title=Enable Central Repository?",
86 "Installer.initialCreateSqlite.messageHeader=The Central Repository is not enabled. Would you like to enable it?",
87 "Installer.initialCreateSqlite.messageDesc=It will store information about all hashes and identifiers that you process. "
88 +
"You can use this to ignore previously seen files and make connections between cases."
104 caseEventListener.installListeners();
116 String initializedStr = centralRepoSettings.get(
"initialized");
119 boolean initialized = Boolean.parseBoolean(initializedStr);
123 boolean prevRepo = Boolean.parseBoolean(centralRepoSettings.get(
"db.useCentralRepo"));
136 SwingUtilities.invokeAndWait(() -> {
140 +
"<div style='width: 400px;'>"
141 +
"<p>" + NbBundle.getMessage(this.getClass(),
"Installer.initialCreateSqlite.messageHeader") +
"</p>"
142 +
"<p style='margin-top: 10px'>" + NbBundle.getMessage(this.getClass(),
"Installer.initialCreateSqlite.messageDesc") +
"</p>"
146 if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(),
148 NbBundle.getMessage(this.getClass(),
"Installer.initialCreateSqlite.title"),
149 JOptionPane.YES_NO_OPTION)) {
154 logger.log(Level.SEVERE,
"There was an error while initializing the central repository database", ex);
159 }
catch (InterruptedException | InvocationTargetException ex) {
160 logger.log(Level.SEVERE,
"There was an error while running the swing utility invoke later while creating the central repository database", ex);
167 logger.log(Level.SEVERE,
"There was an error while initializing the central repository database", ex);
194 @NbBundle.Messages({
"Installer.centralRepoUpgradeFailed.title=Central repository disabled"})
198 SwingUtilities.invokeAndWait(() -> {
199 JOptionPane.showMessageDialog(null,
201 NbBundle.getMessage(this.getClass(),
"Installer.centralRepoUpgradeFailed.title"),
202 JOptionPane.ERROR_MESSAGE);
204 }
catch (InterruptedException | InvocationTargetException e) {
205 logger.log(Level.WARNING, e.getMessage(), e);
229 caseEventListener.uninstallListeners();
230 caseEventListener.shutdown();
231 ingestEventListener.shutdown();
static Version.Type getBuildType()
void setupDefaultSqliteDb()
final IngestEventsListener ingestEventListener
static final long serialVersionUID
static boolean runningWithGUI
static final Logger logger
static Installer instance
void setupDefaultCentralRepository()
static synchronized Installer getDefault()
void uninstallListeners()
static synchronized void setConfigSetting(String moduleName, String settingName, String settingVal)
void doMessageBoxIfRunningInGUI(CentralRepoException ex)
void setupDefaultSqliteCentralRepo()
final CaseEventListener caseEventListener
synchronized static Logger getLogger(String name)
static synchronized Map< String, String > getConfigSettings(String moduleName)
void addApplicationEventListeners()