none
How to detect installed version of the Kinect runtime RRS feed

  • Question

  • Hello,

    Is there a way to detect which version of the Kinect runtime is installed? I couldn't find anything in the registry, so I have developed my own solution, but I believe there could be an easier approach.

    What I do now is basically create an AppDomain and try to get the version of the assembly via reflection. If it throws for any reason, I assume Kinect wasn't installed.

    Since I can't link to older versions with newer SDKs, I can't maintain the code unless I uninstall the latest version (1.8), install the earliest version we've shipped with (1.6), do some work, compile, then update to the current version again (1.8).

    Has anyone found an easier approach to support upgrading a product that updates the runtime in a commercially supported product? Our users are not technical, so everything should be completely automated and shouldn't require action on their part.

    Regards,
    Dilyan Rusev

    Monday, August 4, 2014 8:45 AM

Answers

  • there is a registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\KinectSDK\v1.8

    Keep in mind, that all the v1 SDK are completely backward compatible. If you are distributing an application you should be doing an install of the redist version of the runtime that comes with the SDK.


    Carmine Sirignano - MSFT

    Tuesday, August 5, 2014 4:49 PM

All replies

  • there is a registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\KinectSDK\v1.8

    Keep in mind, that all the v1 SDK are completely backward compatible. If you are distributing an application you should be doing an install of the redist version of the runtime that comes with the SDK.


    Carmine Sirignano - MSFT

    Tuesday, August 5, 2014 4:49 PM
  • Thank you for answering!

    It may not have been clear what we are trying to achieve from my previous post.

    • We ship a commercial product that is based on Kinect and .NET
    • We provide an offline installer, since in most places the internet connection is not reliable or fast enough for an online install
    • This is why we need to minimize the installer size
    • So far as Kinect is concerned, we bundle the Kinect Runtime (not the SDK; runtime is about 110mb and SDK twice as much, at 222mb)
    • Kinect Runtime does not set any registry keys (neither 1.6, 1.7, nor 1.8)
    • This is tested on a clean virtual machine
    • Kinect SDK does set HKLM\SOFTWARE\Microsoft\Kinect\SdkInstallPath and HKLM\SOFTWARE\Microsoft\KinectSDK\vMajor.Minor
    • Kinect SDK does allow end users to use Kinect for Xbox 360 on a Windows PC, which AFAIK we aren't allowed to enable
    • Because of both legal and size restrictions, we cannot ship the SDK to end-users.

    Now, about the backward compatibility

    • Kinect for Windows Runtime indeed is fully backwards compatible
    • Kinect for Windows SDK does not allow you to build projects that link to an older version. By "link" I mean to build an assembly that has a reference to Microsoft.Kinect.dll with version different than that of the installed SDK.
    • When we initially shipped our application, we shipped with K4W Runtime ver 1.6. Since then, 1.7 and 1.8 were released, so we needed to update the K4W Runtime via updates
    • .NET loads assemblies as they are used. This means that so long as you don't use any type from Microsoft.Kinect.dll, your application will not crash if the client has 1.6, but the newer version has been compiled with 1.7 or 1.8
    • There are two ways to detect if everything is OK: run an external program (that is what we do with the installer for technical reasons), or create an AppDomain, try to, for example, run iside it Microsoft.Kinect.JointType.ToString(). Then, the code in the AppDomain will marshal some return value. If it doesn't crash, then the system has the same or newer version of the Kinect Runtime compared to what the application was built against. We execute the code in a different AppDomain to shield ourselves from any unpredicted errors that might crash the entire program (apart from the expected TypeLoadException)
    • The second is a utility program compiled against 1.6. Since the Runtime is backwards compatible, it is guaranteed to run on our oldest installations. Rather than simply saying "yes/no", this little program can report whether K4W is installed at all, and if installed, which exact version is installed.
    • Another way would be for us to set a registry key ourselves, but that is 1) unreliable - users can install/uninstall Kinect on their own; 2) will not work for new users

    This is not a big issue for us, because we have a working solution. I wondered if there were something simpler. If you plan on any upgrades to the Runtime for v1, you could make the Runtime installer write to the registry, as well.

    Again, thank you for responding so quickly!

    Regards,

    Dilyan Rusev

    Wednesday, August 6, 2014 11:27 AM