- if (env.os == OSType.WINDOWS) {
- if (env.arch == ARCHType.X86) {
- bundle = Platform.getBundle("org.simantics.fmil.win32");
- } else if (env.arch == ARCHType.X86_64) {
- bundle = Platform.getBundle("org.simantics.fmil.win64");
- }
- }
-
- if (bundle != null) {
- try{
- String root = FileLocator.getBundleFile(bundle).getAbsolutePath();
-// if (env.arch == ARCHType.X86_64) {
-// File newFIle = new File(root, "libraries/libexpat.dll");
-// System.load(newFIle.getAbsolutePath());
-// }
-// libraries[0] = new File(root, "libraries/zlibwapi.dll");
-// libraries[1] = new File(root, "libraries/miniunz.dll");
- libraries[0] = new File(root, "libraries/fmilib_shared.dll");
- libraries[1] = new File(root, "libraries/FMUSimulator.dll");
- }
- catch (Exception e) {
- e.printStackTrace();
+
+ try {
+ URL sharedFMILIBUrl = null;
+ URL simulatorFMIUrl = null;
+ Bundle b = Platform.getBundle("org.simantics.fmil.core");
+
+ if (env.os == OSType.WINDOWS) {
+ sharedFMILIBUrl = FileLocator.find(b, new Path("libraries/fmilib_shared.dll"), null);
+ simulatorFMIUrl = FileLocator.find(b, new Path("libraries/FMUSimulator.dll"), null);
+ } else if(env.os == OSType.LINUX) {
+ sharedFMILIBUrl = FileLocator.find(b, new Path("libraries/libfmilib_shared.so"), null);
+ simulatorFMIUrl = FileLocator.find(b, new Path("libraries/libFMUSimulator.so"), null);