Skip to content

Commit

Permalink
Added VirtualBox version checking
Browse files Browse the repository at this point in the history
  • Loading branch information
sysprogs committed Sep 30, 2015
1 parent 49fd47a commit 2ac7537
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions VirtualBoxIntegration/App.xaml.cs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ public partial class App : Application
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
public static extern bool IsWow64Process([In] IntPtr hProcess, [Out] out bool lpSystemInfo); 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() public static bool Is64Bit()
{ {
try try
Expand Down
4 changes: 4 additions & 0 deletions VirtualBoxIntegration/MainWindow.xaml.cs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public MainWindow()


_VirtualBox = new VirtualBox.VirtualBox(); _VirtualBox = new VirtualBox.VirtualBox();
lblVersion.Content = _VirtualBox.Version; 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(); var is64Bit = App.Is64Bit();
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Oracle\VirtualBox"); RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Oracle\VirtualBox");
Expand Down

0 comments on commit 2ac7537

Please sign in to comment.