コード例 #1
0
        public VersionInfo(VersionNum versionId, bool isNativeVersion = false)
        {
            VersionId       = versionId;
            IsNativeVersion = isNativeVersion;

            if (isNativeVersion)
            {
                VersionFolderPath   = ABHelper.AppNativeVersionPath;
                VersionFilePath     = string.Format("{0}/{1}", VersionFolderPath, ABHelper.VersionFileName);
                NativeFilePath      = string.Format("{0}/{1}", VersionFolderPath, ABHelper.NativeFileName);
                IsVersionFileExist  = true;
                IsManifestFileExist = true;
            }
            else
            {
                bool fromNativePath = true;
                VersionFolderPath   = string.Format("{0}/{1}/{2}", ABHelper.AppVersionPath, VersionId.Id1A2, VersionId.Id3rd.ToString());
                VersionFilePath     = string.Format("{0}/{1}", VersionFolderPath, ABHelper.VersionFileName);
                IsVersionFileExist  = File.Exists(VersionFilePath);
                IsManifestFileExist = !string.IsNullOrEmpty(GetABFullPath(ABHelper.ManifestFileName, ref fromNativePath));

                if (IsValid)
                {
                    string versionNumPath = GetABFullPath(ABHelper.VersionNumFileName, ref fromNativePath);
                    if (!string.IsNullOrEmpty(versionNumPath))
                    {
                        VersionId.Update(ABHelper.ReadVersionNumFileByPath(versionNumPath));
                    }
                }
            }
        }