private static RandomAccessFile randomAccessFile;
private static boolean isMac = false;
private static boolean isWin = false;
- private static boolean isWin8 = false;
+ private static boolean isWin8AndAbove = false;
private static boolean isLinux = false;
static {
isLinux = true;
} else if (System.getProperty("os.name").toLowerCase().indexOf("win") > -1) { //$NON-NLS-1$ //$NON-NLS-2$
isWin = true;
- if (System.getProperty("os.name").startsWith("Windows 8")) { //$NON-NLS-1$ //$NON-NLS-2$
- isWin8 = true;
+ try {
+ /*The version of Windows8 is 6.2 */
+ if (Float.parseFloat(System.getProperty("os.version")) >= 6.2) { //$NON-NLS-1$ //$NON-NLS-2$
+ isWin8AndAbove = true;
+ }
+ } catch (NumberFormatException e) {
+ EMLogger.getLogger().warning(e.getMessage());
+ isWin8AndAbove = false;
}
} else if (System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) { //$NON-NLS-1$ //$NON-NLS-2$
isMac = true;
return isWin;
}
- public static boolean isWin8() {
- return isWin8;
+ public static boolean isWin8AndAbove() {
+ return isWin8AndAbove;
}
public static boolean isLinux() {
}
}
EMLogger.getLogger().warning("found tapid: " + foundTapId); //$NON-NLS-1$
- if (EmulatorManager.isWin8()) {
+ if (EmulatorManager.isWin8AndAbove()) {
topKey = "SYSTEM\\CurrentControlSet\\services\\NdisImPlatform\\Linkage"; //$NON-NLS-1$
} else {
topKey = "SYSTEM\\CurrentControlSet\\services\\Bridge\\Linkage"; //$NON-NLS-1$
List<String> cmd;
ProcessResult res;
try {
- if (!EmulatorManager.isWin8()) {
+ if (!EmulatorManager.isWin8AndAbove()) {
EMLogger.getLogger().info(
"get CompatibleIDs from pci network device"); //$NON-NLS-1$
cmd = Arrays.asList(getDevconPath(platformVersion), "find", "=net", //$NON-NLS-1$ //$NON-NLS-2$
}
}
- if (!EmulatorManager.isWin8()) {
+ if (!EmulatorManager.isWin8AndAbove()) {
EMLogger.getLogger().info("bind host network to bridge"); //$NON-NLS-1$
String tapPnpInstanceID = getPnpInstanceIDFromName(tapName);
nameText.setLayoutData(data);
nameText.setEnabled(false);
nameText.setText(TapUtil.getAvailableTapName());
- if (!EmulatorManager.isWin8()) {
+ if (!EmulatorManager.isWin8AndAbove()) {
// interface (combo select)
Label ifLabel = new Label(upperComp, SWT.NONE);
ifLabel.setFont(FontResources.DETAIL_TITLE_FONT.getFont());
// Check Tap duplication
// if (TapUtil.nameNotExist(nameText.getText())) {
tapName = nameText.getText();
- if (!EmulatorManager.isWin8()) {
+ if (!EmulatorManager.isWin8AndAbove()) {
ifName = combo.getText();
}
dialog.close();