I propose the fix included at the end of this posting. It will make RM(IR) first search the "old" local location, then the system location.
Nothing will change for the user who has installed in the "old" way. No internet connection is needed.
If someone requests a RemoteMaster.jar to test with, just say so.
No answer is taken as approval.
Code: Select all
Index: com/hifiremote/jp1/RemoteMaster.java
===================================================================
--- com/hifiremote/jp1/RemoteMaster.java (revision 1081)
+++ com/hifiremote/jp1/RemoteMaster.java (working copy)
@@ -2533,7 +2533,7 @@
sb.append( "</ul>" );
sb.append( "<p>Libraries loaded from " );
- sb.append( LibraryLoader.getLibraryFolder() );
+ sb.append( LibraryLoader.getLibraryFolder() != null ? LibraryLoader.getLibraryFolder() : "system path." );
sb.append( "</p></html>" );
JEditorPane pane = new JEditorPane( "text/html", sb.toString() );
Index: com/hifiremote/LibraryLoader.java
===================================================================
--- com/hifiremote/LibraryLoader.java (revision 1081)
+++ com/hifiremote/LibraryLoader.java (working copy)
@@ -33,27 +33,44 @@
{
String mappedName = System.mapLibraryName( libraryName );
File libraryFile = new File( libraryFolder, mappedName );
- System.err.println( "Loading " + libraryFile.getAbsolutePath() );
- System.load( libraryFile.getAbsolutePath() );
- System.err.println( "Loaded " + libraryFile.getAbsolutePath() );
- libraries.put( libraryName, mappedName );
+ System.err.println( "Trying to load " + libraryFile.getAbsolutePath() );
+ try
+ {
+ System.load(libraryFile.getAbsolutePath());
+ System.err.println("Loaded " + libraryFile.getAbsolutePath());
+ libraries.put(libraryName, mappedName);
+ }
+ catch (UnsatisfiedLinkError ex)
+ {
+ System.err.println("Loading of " + libraryFile.getAbsolutePath() + " failed, trying system path.");
+ loadLibrary(libraryName);
+ }
}
}
public static void loadLibrary( String libraryName ) throws UnsatisfiedLinkError
{
- if ( libraries.get( libraryName ) == null )
+ if (libraries.get(libraryName) == null)
{
- System.err.println( "Loading " + libraryName );
- System.loadLibrary( libraryName );
- System.err.println( "Loaded " + libraryName );
- libraries.put( libraryName, libraryName );
+ System.err.println("Trying to load " + libraryName + " from system path" );
+ try
+ {
+ System.loadLibrary(libraryName);
+ System.err.println("Loaded " + libraryName);
+ libraries.put(libraryName, libraryName);
+ libraryFolder = null;
+ }
+ catch (UnsatisfiedLinkError ex)
+ {
+ System.err.println("Loading of " + libraryName + " from system path failed.");
+ throw (ex);
+ }
}
}
public static String getLibraryFolder()
{
- return libraryFolder.getAbsolutePath();
+ return libraryFolder != null ? libraryFolder.getAbsolutePath() : null;
}
protected static HashMap< String, String > libraries = new HashMap< String, String >();