Ejemplo n.º 1
0
 public static void CheckUpdate(string updatedPatcherURI, bool initialCheck)
 {
     try
     {
         WebClient web = new WebClient();
         availableVersion = int.Parse(web.DownloadString(updatedPatcherURI));
         currentVersion   = MainWindow.Ver;
         //MessageBox.Show(availableVersion.ToString() + currentVersion.ToString());
         if (availableVersion > currentVersion)
         {
             Message.PatcherUpdateNotice();
         }
         else
         {
             if (!initialCheck)
             {
                 Message.AlreadyLatest();
             }
         }
         web.Dispose();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         ErrorLogWriter.WriteLog(ex);
     }
 }
Ejemplo n.º 2
0
        private static void TaiwanToJP_Process(IProgress <int> progress, string InstallPath)
        {
            WebClient Web = new WebClient();

            try
            {
                isInstalled_Gamez = File.Exists(InstallPath + "/BDOToolBoxPatch.Installed");
                targetServer      = "Taiwan";
                progress.Report(5);
                var DownloadFile = MainWindow.PatchStreamURI + MainWindow.PatchFileName_TW;
                progress.Report(10);
                //pr.ProgressBox.AppendText("Patch File URI:");
                Web.DownloadFile(DownloadFile, "data/JPModForTW.zip");
                File.Create(InstallPath + "/BDOToolBoxPatch.Installed").Close();
                progress.Report(15);
                if (!File.Exists(InstallPath + "/BDOToolBoxPatch.Installed"))
                {
                    File.Copy(InstallPath + "/Paz/pad00000.meta", "data/tw_pad00000.meta", true);
                }
                progress.Report(20);
                ZipFile zipFile = ZipFile.Read("data/JPModForTW.zip");
                progress.Report(25);
                zipFile["languagedata_tw.txt"].Extract(InstallPath + "/stringtable/tw/", ExtractExistingFileAction.OverwriteSilently);
                progress.Report(40);
                zipFile["pad00000.meta"].Extract(InstallPath + "/Paz/", ExtractExistingFileAction.OverwriteSilently);
                progress.Report(60);
                zipFile["pearl.ttf"].Extract(InstallPath + "/prestringtable/font/", ExtractExistingFileAction.OverwriteSilently);
                progress.Report(80);
                zipFile.Dispose();
                progress.Report(85);
                zipFile = null;
                Web.Dispose();
                progress.Report(95);
                Web = null;
                progress.Report(100);
            }
            catch (ZipException ex)
            {
                Message.InvalidPatchPackage("aa");
            }
            catch (UnauthorizedAccessException ex)
            {
                Message.FailedByPermission();
            }
            catch (Exception ex)
            {
                Message.UnknownErrorWhilePatching();
                ErrorLogWriter.WriteLog(ex);
            }
        }