Exemple #1
0
        public bool UpdateCheck(UpdateCheckSettingsData pSettingsData)
        {
            Console.WriteLine("アップデート確認開始");
            this.UpdateCheckSettingsData = pSettingsData;

            bool downloadResult = this.downloadUnit.FileDownload(pSettingsData.InfoDonwloadUri, pSettingsData.SaveInfoDirectory, pSettingsData.SaveInfoFileName, Framework.SaveType.OverRide);

            if (!downloadResult)
            {
                Console.WriteLine("アップデート確認NG: バージョンファイル取得失敗");
                return(false);
            }

            this.NewPluginVersionInfo = this.xmlSerializerProcess.XmlLoad(Path.Combine(pSettingsData.SaveInfoDirectory, pSettingsData.SaveInfoFileName), typeof(PluginVersionInfo), true) as PluginVersionInfo;
            if (this.NewPluginVersionInfo == null)
            {
                Console.WriteLine("アップデート確認NG: シリアライズ失敗");
                return(false);
            }

            Version v = new Version(this.NewPluginVersionInfo.PluginVersion);

            if (pSettingsData.PluginVersion >= v)
            {
                Console.WriteLine("アップデート確認OK: 最新版なし");
                return(true);
            }

            this.NewPlugin = true;
            Console.WriteLine("アップデート確認OK: 最新版あり");
            return(true);
        }
        /// <summary> プラグインの更新確認を実行します。
        /// </summary>
        /// <param name="pCommonDM"> 設定情報を参照する共通データモデル </param>
        /// <returns> 正常にアップデート確認できた場合 True </returns>
        public bool PluginUpdateCheck(CommonDataModel pCommonDM)
        {
            var ass  = Assembly.GetExecutingAssembly();
            var name = ass.GetName();

            UpdateCheckSettingsData data = new UpdateCheckSettingsData();

            data.PluginVersion = name.Version;
            //data.PluginVersion = new Version(0, 0, 0, 1);
            pCommonDM.LogDataCollection.Add(
                Globals.SysLogger.WriteSystemLog.NonState.DEBUG.Write(string.Format("PluginVersion: {0}", name.Version)));
            data.InfoDonwloadUri   = pCommonDM.PluginVersionInfo.CheckPluginInfoUri;
            data.SaveInfoDirectory = pCommonDM.ApplicationData.RoamingDirectoryPath;
            data.SaveInfoFileName  = "New" + pCommonDM.ApplicationData.VersionInfoFileName;
            if (!string.IsNullOrWhiteSpace(pCommonDM.ApplicationData.PluginDllDirectory))
            {
                data.SaveZipDirectory = pCommonDM.ApplicationData.PluginDllDirectory + @"\Download";
            }
            else
            {
                data.SaveZipDirectory = this.getAssemblyDataProcess.GetAssemblyDirectory() + @"\Download";
            }
            Task.Run(() => this.PluginUpdateObjectModel.UpdateCheck(data));
            return(true);
        }
Exemple #3
0
        /*--- Method: public ------------------------------------------------------------------------------------------------------------------------------------------*/

        public Task <bool> UpdateCheckAsync(UpdateCheckSettingsData pSettingsData)
        {
            return(new Task <bool>(() => this.UpdateCheck(pSettingsData)));
        }