Beispiel #1
0
 private static bool CheckQtVersion(VersionInformation vi)
 {
     if (!vi.qt5Version)
     {
         Messages.DisplayWarningMessage(SR.GetString("ExportProject_EditProjectFileManually"));
         return(false);
     }
     return(true);
 }
Beispiel #2
0
        private string GetDefaultX64Version(RegistryKey root)
        {
            string defaultVersion = null;

            try
            {
                RegistryKey key = root.OpenSubKey("SOFTWARE\\" + regVersionPath, false);
                if (key != null)
                {
                    defaultVersion = (string)key.GetValue("DefaultQtX64Version");
                }
                if (defaultVersion == null)
                {
                    defaultVersion = (string)key.GetValue("DefaultQtVersion");
                }
            }
            catch
            {
                Messages.DisplayWarningMessage(SR.GetString("QtVersionManager_CannotLoadQtVersion"));
            }

            if (defaultVersion == null)
            {
                MergeVersions();
                RegistryKey key = root.OpenSubKey("SOFTWARE\\" + regVersionPath, false);
                if (key != null)
                {
                    string[] versions = GetVersions();
                    if (versions != null && versions.Length > 0)
                    {
                        defaultVersion = versions[versions.Length - 1];
                    }
                    if (defaultVersion != null)
                    {
                        SaveDefaultX86Version(defaultVersion);
                    }
                }
                if (defaultVersion == null)
                {
                    // last fallback... try QTDIR
                    string qtDir = System.Environment.GetEnvironmentVariable("QTDIR");
                    if (qtDir == null)
                    {
                        return(null);
                    }
                    DirectoryInfo d = new DirectoryInfo(qtDir);
                    SaveVersion(d.Name, d.FullName);
                    if (SaveDefaultX86Version(d.Name))
                    {
                        defaultVersion = d.Name;
                    }
                }
            }
            return(VerifyIfQtVersionExists(defaultVersion) ? defaultVersion : null);
        }
Beispiel #3
0
        public string GetDefaultWinCEVersion()
        {
            try {
                var key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\" + regVersionPath, false);
                if (key != null)
                {
                    return(( string )key.GetValue("WinCEQtVersion"));
                }
            }
            catch {
                Messages.DisplayWarningMessage(SR.GetString("QtVersionManager_CannotLoadQtVersion"));
            }

            return(GetDefaultVersion());
        }