home *** CD-ROM | disk | FTP | other *** search
- package com.ms.util;
-
- import com.ms.lang.RegKey;
- import java.util.Enumeration;
- import java.util.Hashtable;
- import java.util.Properties;
- import java.util.Vector;
-
- public class SystemVersionManager implements Runnable {
- int classesbuild;
-
- public static Properties getVMVersion() {
- Properties var0;
- try {
- var0 = getVMVersionData();
- } catch (Throwable var2) {
- var0 = createVersion(4, 79, 0, 1158, "Microsoft (R) VM for Java (tm), 3.0 Release");
- }
-
- return var0;
- }
-
- SystemVersionManager() {
- }
-
- public static Properties getSystemComponentVersion(String var0) {
- if (var0.equals("VM")) {
- return getVMVersion();
- } else if (!var0.equals("Classes") && !var0.equals("TrustedClasses")) {
- return null;
- } else {
- int var1 = 1155;
- SystemVersionManager var2 = new SystemVersionManager();
- Thread var3 = new Thread(var2);
- synchronized(var3){}
-
- try {
- var3.start();
-
- try {
- var3.wait();
- var1 = var2.classesbuild;
- } catch (InterruptedException var12) {
- }
- } catch (Throwable var13) {
- throw var13;
- }
-
- Object var15 = null;
- Object var14 = null;
- String var4 = var0.charAt(0) == 'C' ? "System" : "Trusted";
- String var5;
- if (var1 < 1155) {
- var5 = ", 3.0 Prerelease";
- } else if (var1 == 1155) {
- try {
- Class.forName("com.ms.com.ComContext");
- var5 = ", Visual J++ 1.0 Release";
- } catch (Throwable var11) {
- var5 = ", 3.0 Release";
- }
- } else {
- var5 = ", 3.0a Update";
- }
-
- return createVersion(4, 79, 0, var1, "Microsoft (R) " + var4 + " Classes" + var5);
- }
- }
-
- private static native Properties getVMVersionData();
-
- public static Properties createVersion(int var0, int var1, int var2, int var3, String var4) {
- Properties var5 = new Properties();
- ((Hashtable)var5).put("MajorVersion", Integer.toString(var0));
- ((Hashtable)var5).put("MinorVersion", Integer.toString(var1));
- ((Hashtable)var5).put("BuildNumber", Integer.toString(var2));
- ((Hashtable)var5).put("BuildIncrement", Integer.toString(var3));
- ((Hashtable)var5).put("Description", new String(var4));
- return var5;
- }
-
- public static Properties getPackageVersion(String var0) {
- return null;
- }
-
- public void run() {
- try {
- RegKey var1 = new RegKey(RegKey.getRootKey(2), "Software\\Microsoft\\Java VM", 1);
- this.classesbuild = Integer.parseInt(var1.getStringValue("ClassesBuild"));
- } catch (Throwable var7) {
- this.classesbuild = 1155;
- }
-
- synchronized(this){}
-
- try {
- this.notify();
- } catch (Throwable var6) {
- throw var6;
- }
-
- }
-
- public static Enumeration enumerate() {
- Vector var0 = new Vector();
- var0.addElement("VM");
- var0.addElement("Classes");
- var0.addElement("TrustedClasses");
- return var0.elements();
- }
- }
-