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 javax.swing.SwingWorker;
33 import org.openide.LifecycleManager;
34 import org.openide.modules.ModuleInstall;
35 import org.openide.util.NbBundle;
36 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");
210 packageInstallers =
new ArrayList<>();
229 System.setProperty(
"javafx.macosx.embedded",
"true");
232 JFXPanel panel =
new JFXPanel();
233 Platform.setImplicitExit(
false);
235 }
catch (UnsatisfiedLinkError | NoClassDefFoundError | Exception e) {
237 final String msg = NbBundle.getMessage(
Installer.class,
"Installer.errorInitJavafx.msg");
238 final String details = NbBundle.getMessage(
Installer.class,
"Installer.errorInitJavafx.details");
239 logger.log(Level.SEVERE, msg
242 WindowManager.getDefault().invokeWhenUIReady(
new Runnable() {
253 pythonModulesDir.mkdir();
261 for (ModuleInstall mi : packageInstallers) {
264 logger.log(Level.INFO,
"{0} restore succeeded", mi.getClass().getName());
265 }
catch (Exception e) {
266 String msg = mi.getClass().getName() +
" restore failed";
267 logger.log(Level.WARNING, msg, e);
270 logger.log(Level.INFO,
"Autopsy Core restore completed");
274 public void validate() throws IllegalStateException {
277 logger.log(Level.INFO,
"validate()");
278 for (ModuleInstall mi : packageInstallers) {
279 logger.log(Level.INFO,
"{0} validate()", mi.getClass().getName());
282 }
catch (IllegalStateException e) {
283 logger.log(Level.WARNING,
"", e);
292 logger.log(Level.INFO,
"uninstalled()");
294 for (ModuleInstall mi : packageInstallers) {
295 logger.log(Level.INFO,
"{0} uninstalled()", mi.getClass().getName());
298 }
catch (Exception e) {
299 logger.log(Level.WARNING,
"", e);
305 "Installer.closing.confirmationDialog.title=Ingest is Running",
306 "Installer.closing.confirmationDialog.message=Ingest is running, are you sure you want to exit?",
307 "# {0} - exception message",
"Installer.closing.messageBox.caseCloseExceptionMessage=Error closing case: {0}"
312 WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
313 FutureTask<Void> future =
new FutureTask<>(
new Callable<Void>() {
315 public Void call()
throws Exception {
320 Thread thread =
new Thread(future);
324 }
catch (InterruptedException ex) {
325 logger.log(Level.SEVERE,
"Unexpected interrupt closing the current case", ex);
326 }
catch (ExecutionException ex) {
327 logger.log(Level.SEVERE,
"Error closing the current case", ex);
330 WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
342 logger.log(Level.INFO,
"close()");
349 for (ModuleInstall mi : packageInstallers) {
350 logger.log(Level.INFO,
"{0} close()", mi.getClass().getName());
353 }
catch (Exception e) {
354 logger.log(Level.WARNING,
"", e);
357 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 final Logger logger
static synchronized Installer getDefault()
static volatile boolean javaFxInit
static synchronized Installer getDefault()
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 synchronized Installer getDefault()
static void error(String message)