LWJGLInstaller: Don't allow applets to decide whether to uninstall old lwjgl dirs

This commit is contained in:
Elias Naur 2006-07-11 18:52:13 +00:00
parent b3dcdeb51d
commit 9dfe05a126
1 changed files with 11 additions and 17 deletions

View File

@ -63,9 +63,6 @@ import org.lwjgl.LWJGLUtil;
* $Id$
*/
public class LWJGLInstaller {
/** Whether to hook uninstall rutine. Must be called prior to installation */
public static boolean disableUninstall = false;
/** Whether the installer has been called */
private static boolean installed;
@ -93,7 +90,7 @@ public class LWJGLInstaller {
*
* @see java.lang.ClassLoader#getResource(String)
*/
public static void tempInstall() throws Exception {
public synchronized static void tempInstall() throws Exception {
// only need to install once
if (installed) {
return;
@ -108,19 +105,16 @@ public class LWJGLInstaller {
}
});
// install shutdown installer hook
if(!disableUninstall) {
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
uninstall();
}
});
return null;
}
});
}
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
uninstall();
}
});
return null;
}
});
// create a temporary dir for the native files
String user_temp_dir = getPriviledgedString("java.io.tmpdir");