Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
heyams committed Mar 5, 2024
1 parent 10bafac commit 2887f7b
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

public class EtwProvider {
private static final String LIB_FILENAME_32_BIT =
"inst/applicationinsights-java-etw-provider-x86.dll";
"/inst/applicationinsights-java-etw-provider-x86.dll";
private static final String LIB_FILENAME_64_BIT =
"inst/applicationinsights-java-etw-provider-x86-64.dll";
"/inst/applicationinsights-java-etw-provider-x86-64.dll";

private static final Logger LOGGER = LoggerFactory.getLogger(EtwProvider.class);

Expand All @@ -40,16 +40,22 @@ public EtwProvider(String sdkVersion) {
}
}

@SuppressWarnings("SystemOut")
private static File loadLibrary(String sdkVersion) throws IOException {
String fileName = getDllFilenameForArch();

File targetDir = DllFileUtils.buildDllLocalPath(sdkVersion);
File dllPath = new File(targetDir, fileName);

if (!dllPath.exists()) {
System.out.println("#### default dllPath doesn't exist" + dllPath.getAbsolutePath());
System.out.println("#### extract to local folder instead");
DllFileUtils.extractToLocalFolder(dllPath, fileName);
} else {
System.out.println("#### default dllPath exists" + dllPath.getAbsolutePath());
}

System.out.println("#### finally load dll from " + dllPath.getAbsolutePath());
System.load(dllPath.getAbsolutePath());

return dllPath;
Expand Down

0 comments on commit 2887f7b

Please sign in to comment.