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)); } } } }
public VersionInfo(VersionNum versionId) { VersionId = versionId; VersionFolderPath = string.Format("{0}/{1}/{2}", ABHelper.AppTempCachePath, VersionId.Id1A2, VersionId.Id3rd.ToString()); VersionFilePath = string.Format("{0}/{1}", VersionFolderPath, ABHelper.VersionFileName); IsVersionFileExist = File.Exists(VersionFilePath); VersionNumFilePath = GetABFullPath(ABHelper.VersionNumFileName); IsVersionNumFileExist = null == VersionNumFilePath ? false : File.Exists(VersionNumFilePath); ManifestFilePath = GetABFullPath(ABHelper.ManifestFileName); IsManifestFileExist = null == ManifestFilePath ? false : File.Exists(ManifestFilePath); if (IsValid) { VersionId.Update(ABHelper.ReadVersionNumFile(VersionNumFilePath)); } }