19 package org.sleuthkit.autopsy.core;
21 import java.awt.Cursor;
23 import java.util.ArrayList;
24 import java.util.List;
25 import java.util.concurrent.Callable;
26 import java.util.concurrent.ExecutionException;
27 import java.util.concurrent.FutureTask;
28 import java.util.logging.Handler;
29 import java.util.logging.Level;
30 import javafx.application.Platform;
31 import javafx.embed.swing.JFXPanel;
32 import org.openide.modules.ModuleInstall;
33 import org.openide.util.NbBundle;
34 import org.openide.windows.WindowManager;
77 System.loadLibrary(
"api-ms-win-core-console-l1-1-0");
78 System.loadLibrary(
"api-ms-win-core-datetime-l1-1-0");
79 System.loadLibrary(
"api-ms-win-core-debug-l1-1-0");
80 System.loadLibrary(
"api-ms-win-core-errorhandling-l1-1-0");
81 System.loadLibrary(
"api-ms-win-core-file-l1-1-0");
82 System.loadLibrary(
"api-ms-win-core-file-l1-2-0");
83 System.loadLibrary(
"api-ms-win-core-file-l2-1-0");
84 System.loadLibrary(
"api-ms-win-core-handle-l1-1-0");
85 System.loadLibrary(
"api-ms-win-core-heap-l1-1-0");
86 System.loadLibrary(
"api-ms-win-core-interlocked-l1-1-0");
87 System.loadLibrary(
"api-ms-win-core-libraryloader-l1-1-0");
88 System.loadLibrary(
"api-ms-win-core-localization-l1-2-0");
89 System.loadLibrary(
"api-ms-win-core-memory-l1-1-0");
90 System.loadLibrary(
"api-ms-win-core-namedpipe-l1-1-0");
91 System.loadLibrary(
"api-ms-win-core-processenvironment-l1-1-0");
92 System.loadLibrary(
"api-ms-win-core-processthreads-l1-1-0");
93 System.loadLibrary(
"api-ms-win-core-processthreads-l1-1-1");
94 System.loadLibrary(
"api-ms-win-core-profile-l1-1-0");
95 System.loadLibrary(
"api-ms-win-core-rtlsupport-l1-1-0");
96 System.loadLibrary(
"api-ms-win-core-string-l1-1-0");
97 System.loadLibrary(
"api-ms-win-core-synch-l1-1-0");
98 System.loadLibrary(
"api-ms-win-core-synch-l1-2-0");
99 System.loadLibrary(
"api-ms-win-core-sysinfo-l1-1-0");
100 System.loadLibrary(
"api-ms-win-core-timezone-l1-1-0");
101 System.loadLibrary(
"api-ms-win-core-util-l1-1-0");
102 System.loadLibrary(
"api-ms-win-crt-conio-l1-1-0");
103 System.loadLibrary(
"api-ms-win-crt-convert-l1-1-0");
104 System.loadLibrary(
"api-ms-win-crt-environment-l1-1-0");
105 System.loadLibrary(
"api-ms-win-crt-filesystem-l1-1-0");
106 System.loadLibrary(
"api-ms-win-crt-heap-l1-1-0");
107 System.loadLibrary(
"api-ms-win-crt-locale-l1-1-0");
108 System.loadLibrary(
"api-ms-win-crt-math-l1-1-0");
109 System.loadLibrary(
"api-ms-win-crt-multibyte-l1-1-0");
110 System.loadLibrary(
"api-ms-win-crt-private-l1-1-0");
111 System.loadLibrary(
"api-ms-win-crt-process-l1-1-0");
112 System.loadLibrary(
"api-ms-win-crt-runtime-l1-1-0");
113 System.loadLibrary(
"api-ms-win-crt-stdio-l1-1-0");
114 System.loadLibrary(
"api-ms-win-crt-string-l1-1-0");
115 System.loadLibrary(
"api-ms-win-crt-time-l1-1-0");
116 System.loadLibrary(
"api-ms-win-crt-utility-l1-1-0");
118 System.loadLibrary(
"ucrtbase");
119 System.loadLibrary(
"vcruntime140");
120 System.loadLibrary(
"msvcp140");
122 logger.log(Level.INFO,
"Visual C Runtime libraries loaded");
123 }
catch (UnsatisfiedLinkError e) {
124 logger.log(Level.SEVERE,
"Error loading Visual C Runtime libraries, ", e);
128 System.loadLibrary(
"zlib");
129 logger.log(Level.INFO,
"ZLIB library loaded loaded");
130 }
catch (UnsatisfiedLinkError e) {
131 logger.log(Level.SEVERE,
"Error loading ZLIB library, ", e);
135 System.loadLibrary(
"libewf");
136 logger.log(Level.INFO,
"EWF library loaded");
137 }
catch (UnsatisfiedLinkError e) {
138 logger.log(Level.SEVERE,
"Error loading EWF library, ", e);
142 System.loadLibrary(
"libvmdk");
143 logger.log(Level.INFO,
"VMDK library loaded");
144 }
catch (UnsatisfiedLinkError e) {
145 logger.log(Level.SEVERE,
"Error loading VMDK library, ", e);
149 System.loadLibrary(
"libvhdi");
150 logger.log(Level.INFO,
"VHDI library loaded");
151 }
catch (UnsatisfiedLinkError e) {
152 logger.log(Level.SEVERE,
"Error loading VHDI library, ", e);
159 System.loadLibrary(
"msvcr120");
160 logger.log(Level.INFO,
"MSVCR 120 library loaded");
161 }
catch (UnsatisfiedLinkError e) {
162 logger.log(Level.SEVERE,
"Error loading MSVCR120 library, ", e);
166 System.loadLibrary(
"libeay32");
167 logger.log(Level.INFO,
"LIBEAY32 library loaded");
168 }
catch (UnsatisfiedLinkError e) {
169 logger.log(Level.SEVERE,
"Error loading LIBEAY32 library, ", e);
173 System.loadLibrary(
"ssleay32");
174 logger.log(Level.INFO,
"SSLEAY32 library loaded");
175 }
catch (UnsatisfiedLinkError e) {
176 logger.log(Level.SEVERE,
"Error loading SSLEAY32 library, ", e);
180 System.loadLibrary(
"libiconv-2");
181 logger.log(Level.INFO,
"libiconv-2 library loaded");
182 }
catch (UnsatisfiedLinkError e) {
183 logger.log(Level.SEVERE,
"Error loading libiconv-2 library, ", e);
187 System.loadLibrary(
"libintl-8");
188 logger.log(Level.INFO,
"libintl-8 library loaded");
189 }
catch (UnsatisfiedLinkError e) {
190 logger.log(Level.SEVERE,
"Error loading libintl-8 library, ", e);
194 System.loadLibrary(
"libpq");
195 logger.log(Level.INFO,
"LIBPQ library loaded");
196 }
catch (UnsatisfiedLinkError e) {
197 logger.log(Level.SEVERE,
"Error loading LIBPQ library, ", e);
203 logger.log(Level.INFO,
"core installer created");
207 System.setProperty(
"sun.java2d.dpiaware",
"false");
208 System.setProperty(
"prism.allowhidpi",
"false");
213 packageInstallers =
new ArrayList<>();
229 int ordinal = Integer.parseInt(mode);
249 System.setProperty(
"javafx.macosx.embedded",
"true");
252 JFXPanel panel =
new JFXPanel();
253 Platform.setImplicitExit(
false);
255 }
catch (UnsatisfiedLinkError | NoClassDefFoundError | Exception e) {
257 final String msg = NbBundle.getMessage(
Installer.class,
"Installer.errorInitJavafx.msg");
258 final String details = NbBundle.getMessage(
Installer.class,
"Installer.errorInitJavafx.details");
259 logger.log(Level.SEVERE, msg
262 WindowManager.getDefault().invokeWhenUIReady(
new Runnable() {
277 objectDetectionClassifierDir.mkdir();
286 pythonModulesDir.mkdir();
295 for (ModuleInstall mi : packageInstallers) {
298 logger.log(Level.INFO,
"{0} restore succeeded", mi.getClass().getName());
299 }
catch (Exception e) {
300 String msg = mi.getClass().getName() +
" restore failed";
301 logger.log(Level.WARNING, msg, e);
304 logger.log(Level.INFO,
"Autopsy Core restore completed");
308 public void validate() throws IllegalStateException {
311 logger.log(Level.INFO,
"validate()");
312 for (ModuleInstall mi : packageInstallers) {
313 logger.log(Level.INFO,
"{0} validate()", mi.getClass().getName());
316 }
catch (IllegalStateException e) {
317 logger.log(Level.WARNING,
"", e);
326 logger.log(Level.INFO,
"uninstalled()");
328 for (ModuleInstall mi : packageInstallers) {
329 logger.log(Level.INFO,
"{0} uninstalled()", mi.getClass().getName());
332 }
catch (Exception e) {
333 logger.log(Level.WARNING,
"", e);
339 "Installer.closing.confirmationDialog.title=Ingest is Running",
340 "Installer.closing.confirmationDialog.message=Ingest is running, are you sure you want to exit?",
341 "# {0} - exception message",
"Installer.closing.messageBox.caseCloseExceptionMessage=Error closing case: {0}"
346 WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
347 FutureTask<Void> future =
new FutureTask<>(
new Callable<Void>() {
349 public Void call()
throws Exception {
354 Thread thread =
new Thread(future);
358 }
catch (InterruptedException ex) {
359 logger.log(Level.SEVERE,
"Unexpected interrupt closing the current case", ex);
360 }
catch (ExecutionException ex) {
361 logger.log(Level.SEVERE,
"Error closing the current case", ex);
364 WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
376 logger.log(Level.INFO,
"close()");
383 for (ModuleInstall mi : packageInstallers) {
384 logger.log(Level.INFO,
"{0} close()", mi.getClass().getName());
387 }
catch (Exception e) {
388 logger.log(Level.WARNING,
"", e);
391 for (Handler h : logger.getHandlers()) {
static void loadDynLibraries()
static final long serialVersionUID
static boolean isJavaFxInited()
static void closeCurrentCase()
static boolean checkAndConfirmProceed(String optionsDlgTitle, String optionsDlgMessage)
static void setMode(SelectedMode mode)
static final Logger logger
static final String SETTINGS_PROPERTIES
static synchronized Installer getDefault()
static synchronized Installer getDefault()
static synchronized void setConfigSetting(String moduleName, String settingName, String settingVal)
static volatile boolean javaFxInit
static synchronized Installer getDefault()
static synchronized Installer getDefault()
static String getConfigSetting(String moduleName, String settingName)
static void ensurePythonModulesFolderExists()
static synchronized Installer getDefault()
static void error(String title, String message)
synchronized static Logger getLogger(String name)
final List< ModuleInstall > packageInstallers
static void ensureClassifierFolderExists()
static synchronized Installer getDefault()
static void error(String message)