Skip to content

Kinect Apps – ensuring Kinect Runtime is installed

January 11, 2012

Kinect for Windows 1.0 enabled apps should ensure that the Kinect Runtime is installed wherever the app is installed.

[Note: Kinect for Windows 1.0’s latest public preview is beta 2. Parts of this blog post may be applicable to beta 2, but is primarily focused on the final v1.0 version, coming February 1st. Since v1.0 is not yet released, information I give here may change when it does release. I also am filtering this information to ensure that I am not giving away details that we don’t yet want to release.]

Guidelines

App installers should install its dependencies, including Kinect Runtime – CRITICAL

Kinect for Windows 1.0 will have a KinectRuntime-v1.0-Setup.exe that your appĀ installer MUST chain install. In addition to installing Kinect specific software (drivers + runtime), KinectRuntime-v1.0-Setup.exe will ensure the following dependencies are installed:

  • VCRT x86 and/or x64
  • .NET 4 client profile (or later 4.x versions like .NET 4.5)
  • Microsoft Speech Runtime v11 x86 and/or x64

Running an app should provide a decent user experience if Kinect Runtime isn’t installed – RECOMMENDED

    • .NET Applications

If your Kinect App is a .NET 4.x based app (WPF, XNA, WindowsForms, etc…), code like the following sample may help improve your apps user experience in case the Kinect Runtime 1.0 is not installed.

    //App.xaml.cs
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            if (IsKinectRuntimeInstalled)
            {
                //go ahead and load the StartupUri as defined in App.xaml
                base.OnStartup(e);
            }
            else
            {
                MessageBox.Show(Assembly.GetExecutingAssembly().FullName + " is not able to excecute."
                + "An important dependency should have been installed by its setup program: Microsoft Kinect Runtime 1.0");
            }
        }

        public bool IsKinectRuntimeInstalled {
            get
            {
                bool isInstalled;
                try
                {
                    TestForKinectTypeLoadException();
                    isInstalled = true;
                }
                catch (FileNotFoundException)
                {
                    isInstalled = false;
                }
                return isInstalled;
            }
        }

        // This Microsoft.Kinect.dll based type, must be isolated in its own method
        // as the CLR will attempt to load the Microsoft.Kinect.dll assembly it when this method is executed.
        private void TestForKinectTypeLoadException()
        {
#pragma warning disable 219 //ignore the fact that status is unused code after this set.
            var status = KinectStatus.Disconnected;
#pragma warning restore 219
        }
    }
  • Native Applications

If your Kinect App is a Native Windows based app (C++ using GDI/GDI+/D2D/DirectX/etc..), your application should handle a missing Kinect10.dll in a way that informs the user of the problem and how to fix it.

From → Kinect

5 Comments
  1. trnrao permalink

    Very informative blog. Thank You.

    I have a query on the following scenario – If my ‘Kinect for Windows’ application targets .NET 4.5 (in which client profile has been done away with), does “KinectRuntime-v1.6-Setup.exe” install .NET 4.5 Framework CLR/Run time as well?

    By looking at the size of “KinectRuntime-v1.6-Setup.exe” (~110MB), I believe that it has got { Kinect drivers/etc + .NET 4.0 Client Profile + .NET 4.5 Framework Full }..

    • Runtime setup will download .net framework 4.0 if it (or 4.5) isn’t already installed.
      If u need .net 4.5, your setup should chain install .net 4.5 before installing the Kinect runtime.

      Wish you well, Rob

      • trnrao permalink

        Rob,

        Thank You again.

        We are following the same/correct order now – { .NET 4.0 Install –> Kinect Runtime –> Application Install } for windows 7 desktops.

      • if u need .net 4.0, insteas of .net 4.5, you should be able to just install kinect runtime and then your app. if u need .net 4.5, u need to install it (or verify it is already installed) before you install kinect runtime.

Trackbacks & Pingbacks

  1. Windows Client Developer Roundup 086 for 1/11/2012 - Pete Brown's 10rem.net

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: