Roll back the win_install_to_program_files option - it didn't work anyway.
This commit is contained in:
@@ -31,10 +31,6 @@ import java.net.URL;
|
||||
import javax.swing.JApplet;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import ca.beq.util.win32.registry.RegistryKey;
|
||||
import ca.beq.util.win32.registry.RegistryValue;
|
||||
import ca.beq.util.win32.registry.RootKey;
|
||||
|
||||
import com.samskivert.util.RunAnywhere;
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
@@ -235,17 +231,7 @@ public class GetdownApplet extends JApplet
|
||||
|
||||
// when run from an applet, we install to the user's home directory
|
||||
String root;
|
||||
boolean includeHome = true;
|
||||
if (RunAnywhere.isWindows()) {
|
||||
String propStr = System.getProperty("win_install_to_program_files");
|
||||
boolean useProgFiles =
|
||||
StringUtil.isBlank(propStr) ? false : propStr.equals("true");
|
||||
if (useProgFiles) {
|
||||
RegistryKey.initialize();
|
||||
RegistryKey r = new RegistryKey(RootKey.HKEY_LOCAL_MACHINE, PROGRAM_FILES);
|
||||
root = r.getValue("ProgramFilesDir").getStringValue();
|
||||
includeHome = false;
|
||||
} else {
|
||||
root = "Application Data";
|
||||
String verStr = System.getProperty("os.version");
|
||||
try {
|
||||
@@ -254,17 +240,15 @@ public class GetdownApplet extends JApplet
|
||||
root = "AppData" + File.separator + "LocalLow";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.warning("Couldn't parse OS version [vers=" + verStr +
|
||||
", error=" + e + "].");
|
||||
}
|
||||
Log.warning("Couldn't parse OS version [vers=" + verStr + ", error=" + e + "].");
|
||||
}
|
||||
} else if (RunAnywhere.isMacOS()) {
|
||||
root = "Library" + File.separator + "Application Support";
|
||||
} else /* isLinux() or something wacky */ {
|
||||
root = ".getdown";
|
||||
}
|
||||
String homePrefix = includeHome ? System.getProperty("user.home") + File.separator : "";
|
||||
File appdir = new File(homePrefix + root + File.separator + appname);
|
||||
File appdir = new File(System.getProperty("user.home") + File.separator + root +
|
||||
File.separator + appname);
|
||||
|
||||
// if our application directory does not exist, auto-create it
|
||||
if (!appdir.exists() || !appdir.isDirectory()) {
|
||||
@@ -318,6 +302,4 @@ public class GetdownApplet extends JApplet
|
||||
|
||||
/** An error encountered during initialization. */
|
||||
protected String _errmsg;
|
||||
|
||||
protected static final String PROGRAM_FILES = "Software\\Microsoft\\Windows\\CurrentVersion";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user