Skip to content
Permalink
Browse files
8254843: Exception launching app on windows in some cases
Reviewed-by: asemenyuk, kcr, almatvee, kizune
  • Loading branch information
Andy Herrick committed Oct 20, 2020
1 parent 856037c commit acacae5e0c58dc711de16edcef0022fe162c1ad9
Showing with 5 additions and 15 deletions.
  1. +5 −15 src/jdk.incubator.jpackage/windows/native/applauncher/WinLauncher.cpp
@@ -105,21 +105,11 @@ class DllWrapper {
public:
DllWrapper(const tstring& dllName) {
try {
// Try load DLL.
dll = std::unique_ptr<Dll>(new Dll(dllName));
LOG_TRACE(tstrings::any() << "Load [" << dllName << "]: OK");
}
catch (const std::exception&) {
// JVM DLL load failed, though it exists in file system.
try {
// Try adjust the DLL search paths with AddDllDirectory() WINAPI CALL
dll = loadDllWithAddDllDirectory(dllName);
}
catch (const std::exception&) {
// AddDllDirectory() didn't work. Try altering PATH environment
// variable as the last resort.
dll = loadDllWithAlteredPATH(dllName);
}
// Adjust the DLL search paths with AddDllDirectory() WINAPI CALL
dll = loadDllWithAddDllDirectory(dllName);
} catch (const std::exception&) {
// Alter PATH environment variable as the last resort.
dll = loadDllWithAlteredPATH(dllName);
}
}

1 comment on commit acacae5

@bridgekeeper

This comment has been minimized.

Copy link

@bridgekeeper bridgekeeper bot commented on acacae5 Oct 20, 2020

Please sign in to comment.