Inheritance: RIM.VSNDK_Package.Signing.Models.NotifyPropertyChanged
コード例 #1
0
        /// <summary>
        /// DebugTokenDialog Constructor
        /// </summary>
        public DebugTokenDialog()
        {
            DebugTokenData._initializedCorrectly = true;

            InitializeComponent();

            if (DebugTokenData._initializedCorrectly == false)
            {
                btnAdd.IsEnabled = false;
                btnRefresh.IsEnabled = false;
                IsClosing = true;
                this.Close();
                return;
            }
            deployTokenData = gridMain.DataContext as DebugTokenData;

            if (deployTokenData.Error != "")
            {
                MessageBox.Show(deployTokenData.Error, PkgResources.Errors);
                deployTokenData.Error = "";

                IsClosing = true;

                Close();

            }

            btnAdd.IsEnabled = !deployTokenData.AlreadyRegistered;
            btnRefresh.IsEnabled = deployTokenData.AlreadyRegistered;
        }
コード例 #2
0
        /// <summary>
        /// Validate to make sure device matches the API Level chosen.
        /// </summary>
        /// <returns></returns>
        public bool validateDeviceVersion(bool isSim)
        {
            bool retVal = false;
            string baseVersion = "10.2.0.0";
            string currentAPIVersion = getCurrentAPIVersion();
            DebugTokenData dtokenData;

            if (!isSim)
            {
                dtokenData = new DebugTokenData();
                string LocalFolder = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\";
                string CertPath = LocalFolder + "author.p12";

                if (!File.Exists(CertPath))
                {
                    return false;
                }
            }

            getDeviceSimInfo(isSim);

            if (getDeviceInfo())
            {
                string buildVersion = getBuildVersion();
                if ((buildVersion != "") && (_deviceosversion != "") && (compareVersions(_deviceosversion, buildVersion) < 0))
                {
                    if (isSim)
                    {
                        MessageBox.Show("The simulator operating system does not support the API level used to build the app.\n\nSimulator operating system version: " + _deviceosversion + "\nAPI level version used to build the app: " + buildVersion + "\n\nPlease select an API level that is supported by the operating system and rebuild the project before start debugging.", "API level not supported by the simulator's operating system", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                    else
                    {
                        MessageBox.Show("The device operating system does not support the API level used to build the app.\n\nDevice operating system version: " + _deviceosversion + "\nAPI level version used to build the app: " + buildVersion + "\n\nPlease select an API level that is supported by the operating system and rebuild the project before start debugging.", "API level not supported by the device's operating system", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                    return false;
                }

                if (_deviceosversion == currentAPIVersion)
                {
                    SetRuntime("");
                    retVal = true;
                }
                else if ((_deviceosversion.Substring(0, 4) == "10.1") || (_deviceosversion.Substring(0, 4) == "10.0"))
                {
                    SetRuntime("");
                    if (IsAPIInstalled(_deviceosversion, "") > 0)
                    {
                        retVal = true;
                    }
                    else
                    {
                        UpdateManagerDialog umd = new UpdateManagerDialog("The API Level for the operating system version of the attached device is not currently installed.  Would you like to install it now?", _deviceosversion, false, false);

                        if (umd.ShowDialog() == true)
                        {
                            retVal = true;
                        }
                        else
                        {
                            retVal = false;
                        }
                    }
                }
                else if (IsRuntimeInstalled(_deviceosversion))
                {
                    SetRuntime(_deviceosversion);
                    retVal = true;
                }
                else
                {
                    UpdateManagerDialog umd = new UpdateManagerDialog("The Runtime Libraries for the operating system version of the attached device are not currently installed.  Would you like to install them now?", _deviceosversion, true, false);
                    if (umd.ShowDialog() == true)
                    {
                        // runtime was already set by the Update Manager.
                        retVal = true;
                    }
                    else
                    {
                        SetRuntime("");
                        retVal = false;
                    }
                }
            }

            return retVal;
        }
コード例 #3
0
        /// <summary>
        /// Validate to make sure device matches the API Level chosen.
        /// </summary>
        /// <returns></returns>
        public bool validateDeviceVersion(bool isSim)
        {
            bool retVal = false;
            string baseVersion = "10.2.0.0";
            DebugTokenData dtokenData;

            if (!isSim)
                dtokenData = new DebugTokenData();

            getDeviceSimInfo(isSim);

            if (getDeviceInfo())
            { //** Device Info retrieved - validate API's
                if (getCurrentAPIVersion() != _deviceosversion)
                { //** Currently selected API version is different from attached device OS version.
                    if (IsAPIInstalled(_deviceosversion, "", false) > 0)
                    {
                        retVal = true;
                    }
                    else
                    {
                        if (baseVersion.CompareTo(_deviceosversion) > 0)
                        {
                            UpdateManagerDialog umd = new UpdateManagerDialog("The API Level for the operating system version of the attached device is not currently installed.  Would you like to install it now?", _deviceosversion, false, false);

                            if (umd.ShowDialog() == true)
                            {
                                retVal = true;
                            }
                            else
                            {
                                retVal = false;
                            }
                        }
                        else
                        {
                            if (IsRuntimeInstalled(_deviceosversion))
                            {
                                retVal = true;
                            }
                            else
                            {
                                if (IsAPIInstalled(_deviceosversion.Substring(0, _deviceosversion.LastIndexOf('.')), "", true) == 0)
                                {
                                    string apiLevel = GetAPILevel(_deviceosversion.Substring(0, _deviceosversion.LastIndexOf('.')));

                                    if (apiLevel != "")
                                    {
                                        UpdateManagerDialog umd = new UpdateManagerDialog("The API Level for the operating system version of the attached device is not currently installed.  Would you like to install it now?", apiLevel, false, false);
                                        if (umd.ShowDialog() == true)
                                        {
                                            umd = new UpdateManagerDialog("The Runtime Libraries for the operating system version of the attached device are not currently installed.  Would you like to install them now?", _deviceosversion, true, false);
                                            if (umd.ShowDialog() == true)
                                            {
                                                retVal = true;
                                            }
                                            else
                                            {
                                                retVal = false;
                                            }
                                        }
                                        else
                                        {
                                            retVal = false;
                                        }
                                    }
                                    else
                                        MessageBox.Show("API level not supported at this moment.\n\nAborting...", "API level not supported", MessageBoxButton.OK, MessageBoxImage.Error);
                                }
                                else
                                {
                                    UpdateManagerDialog umd = new UpdateManagerDialog("The Runtime Libraries for the operating system version of the attached device are not currently installed.  Would you like to install them now?", _deviceosversion, true, false);
                                    if (umd.ShowDialog() == true)
                                    {
                                        retVal = true;
                                    }
                                    else
                                    {
                                        retVal = false;
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    retVal = true;
                }
            }
            else
            {
                retVal = false;
            }

            return retVal;
        }
コード例 #4
0
        public void Setup()
        {
            /// Create Object
            DebugTokenObject = new RIM.VSNDK_Package.DebugToken.Model.DebugTokenData();

            /// Set Paths - This would normally be done by the creation of the package.
            RegistryKey rkHKCU = Registry.CurrentUser;
            RegistryKey rkNDKPath = null;
            string qnx_target = "";
            string qnx_host = "";

            rkNDKPath = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
            qnx_host = rkNDKPath.GetValue("NDKHostPath").ToString();
            qnx_target = rkNDKPath.GetValue("NDKHostPath").ToString();

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

            System.Environment.SetEnvironmentVariable("QNX_TARGET", qnx_target);
            System.Environment.SetEnvironmentVariable("QNX_HOST", qnx_host);
            System.Environment.SetEnvironmentVariable("QNX_CONFIGURATION", qnx_config);

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