示例#1
0
 internal static bool DownloadLatestVersion(Form parent, Settings settings)
 {
     using (FormWebpageDownload dlc = new FormWebpageDownload(CemuUrl, "Latest Version"))
     {
         dlc.ShowDialog(parent);
         foreach (var line in dlc.Result.Split('\n'))
         {
             if (line.Contains("name=\"download\""))
             {
                 string[] toks           = line.Split('=');
                 string   ver            = toks[1].Substring(1, toks[1].LastIndexOf('\"') - 1);
                 int      currentVersion = InstalledVersion.GetVersionNumber(Path.GetFileName(ver));
                 if (!IsInstalled(currentVersion, settings))
                 {
                     return(true);
                 }
                 else
                 {
                     MessageBox.Show(Resources.CemuFeatures_DownloadLatestVersion_The_latest_version_of_Cemu_is_already_installed_, Resources.CemuFeatures_DownloadLatestVersion_Information___);
                     return(false);
                 }
             }
         }
     }
     return(false);
 }
 private void DoTheCemu()
 {
     foreach (var line in Result.Split('\n'))
     {
         if (line.Contains("name=\"download\""))
         {
             string[] toks = line.Split('=');
             uris[3]      = toks[1].Substring(1, toks[1].LastIndexOf('\"') - 1);
             fileNames[3] = uris[3].Substring(1 + uris[3].LastIndexOf('/'));
             int currentVersion = InstalledVersion.GetVersionNumber(Path.GetFileName(fileNames[3]));
             if (IsInstalled(currentVersion))
             {
                 uris[3] = "";
             }
         }
     }
 }