gfb107 wrote:RM/RMIR expects the current/working directory to be the directory that contains RemoteMaster.jar, protocols.ini, digitmaps.bin and a number of other files and directories. It also expects to have full read/write/execute permission to those files and directories.
So I decided to check what was needed to make the program "clean" in this sense. (Not only for Windows 7/Vista: In the Unix/Linux world this has been "good manners" since start of the 1990-ties, "mounting /usr read-only".) To my surprise, code for putting the properties file in a more sane place was, for Windows, already implemented. Fot "other" operating systems, I implemented a fix putting the properties file in the user's home directory, staring with a period, as is the common convention on Unix/Linux. Remains the error output file rmaster.err. I implemented a simple fix, putting it in the "system temporary directory" (java.io.tmpdir), amounts to /tmp on Unix/Linux and %HOME%\AppData\Local\Temp on Windows. Here are the changes:vicky2003 wrote:Windows Vista and Window 7 hates it if an app writes information in the "Program Files" sub folders from an app. "Program Files" is a restricted directory. Any changes to the program files directory after installation go in a hidden data stores area. A normal user can't find them, you even a reinstall can't fix them.
I normally don't recommend installing JP1 programs in the Program Files Folder simply because many of the older programs are not Windows 7 compliant and tend to store information in their home folder.
Code: Select all
Index: RemoteMaster.java
===================================================================
--- RemoteMaster.java (revision 1077)
+++ RemoteMaster.java (working copy)
@@ -2916,7 +2916,7 @@
try
{
- System.setErr( new PrintStream( new FileOutputStream( new File( workDir, "rmaster.err" ) ) ) );
+ System.setErr( new PrintStream( new FileOutputStream( new File( System.getProperty("java.io.tmpdir"), "rmaster.err" ) ) ) );
}
catch ( Exception e )
{
@@ -2969,9 +2969,15 @@
{
dir.mkdirs();
}
+ propertiesFile = new File( dir, "RemoteMaster.properties" );
}
-
- propertiesFile = new File( dir, "RemoteMaster.properties" );
+ else // not Windows
+ {
+ String baseFolderName = System.getProperty( "user.home" );
+ if (baseFolderName != null && !baseFolderName.isEmpty())
+ dir = new File( baseFolderName );
+ propertiesFile = new File( dir, ".RemoteMaster.properties" );
+ }
}
}
PropertyFile properties = new PropertyFile( propertiesFile );
Testing and feedback solicited.