Skip to content
Permalink
Browse files

Added VirtualBox version checking

  • Loading branch information
sysprogs committed Sep 30, 2015
1 parent 49fd47a commit 2ac7537a769b50529082901c063c3678da2d599a
Showing with 15 additions and 0 deletions.
  1. +11 −0 VirtualBoxIntegration/App.xaml.cs
  2. +4 −0 VirtualBoxIntegration/MainWindow.xaml.cs
@@ -20,6 +20,17 @@ public partial class App : Application
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool IsWow64Process([In] IntPtr hProcess, [Out] out bool lpSystemInfo);


public App()
{
this.DispatcherUnhandledException += App_DispatcherUnhandledException;
}

void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
MessageBox.Show(e.Exception.ToString(), "VirtualBoxIntegration", MessageBoxButton.OK, MessageBoxImage.Error);
}

public static bool Is64Bit()
{
try
@@ -36,6 +36,10 @@ public MainWindow()

_VirtualBox = new VirtualBox.VirtualBox();
lblVersion.Content = _VirtualBox.Version;
if (int.Parse(_VirtualBox.Version.Split('.')[0]) < 5)
{
throw new Exception("VirtualBox older than 5.0 detected. Please install VirtualBox 5.0 or later to use this version of VirtualKD.");
}

var is64Bit = App.Is64Bit();
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Oracle\VirtualBox");

0 comments on commit 2ac7537

Please sign in to comment.