RIM.VSNDK_Package.Settings.Models.SettingsData.setNDKPaths C# (CSharp) Method

setNDKPaths() public method

Set the NDK Path into the register for future reference by the MSBUILD
public setNDKPaths ( ) : void
return void
        public void setNDKPaths()
        {
            RegistryKey rkHKCU = Registry.CurrentUser;
            RegistryKey rkNDKPath = null;

            try
            {
                rkNDKPath = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
                rkNDKPath.SetValue("NDKHostPath", _ndkEntry.HostPath);
                rkNDKPath.SetValue("NDKTargetPath", _ndkEntry.TargetPath);

                string qnx_config = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK";

                System.Environment.SetEnvironmentVariable("QNX_TARGET", _ndkEntry.TargetPath);
                System.Environment.SetEnvironmentVariable("QNX_HOST", _ndkEntry.HostPath);
                System.Environment.SetEnvironmentVariable("QNX_CONFIGURATION", qnx_config);

                string ndkpath = string.Format(@"{0}/usr/bin;{1}\bin;{0}/usr/qde/eclipse/jre/bin;", _ndkEntry.HostPath, qnx_config) +
                    System.Environment.GetEnvironmentVariable("PATH");
                System.Environment.SetEnvironmentVariable("PATH", ndkpath);
            }
            catch
            {

            }
            rkNDKPath.Close();
            rkHKCU.Close();
        }