private void DetectUpdate(object sender, Bootstrapper.DetectUpdateEventArgs e) { // The list of updates is sorted in descending version, so the first callback should be the largest update available. // This update should be either larger than ours (so we are out of date), the same as ours (so we are current) // or smaller than ours (we have a private build). If we really wanted to, we could leave the e.Result alone and // enumerate all of the updates. WixBA.Model.Engine.Log(LogLevel.Verbose, String.Format("Potential update v{0} from '{1}'; current version: v{2}", e.Version, e.UpdateLocation, WixBA.Model.Version)); if (e.Version > WixBA.Model.Version) { WixBA.Model.Engine.SetUpdate(null, e.UpdateLocation, e.Size, UpdateHashType.None, null); this.State = UpdateState.Available; e.Result = Result.Ok; } else if (e.Version <= WixBA.Model.Version) { this.State = UpdateState.Current; e.Result = Result.Cancel; } }
private void DetectUpdate(object sender, Bootstrapper.DetectUpdateEventArgs e) { // The list of updates is sorted in descending version, so the first callback should be the largest update available. // This update should be either larger than ours (so we are out of date), the same as ours (so we are current) // or smaller than ours (we have a private build). If we really wanted to, we could leave the e.StopProcessingUpdates alone and // enumerate all of the updates. WixBA.Model.Engine.Log(LogLevel.Verbose, String.Format("Potential update v{0} from '{1}'; current version: v{2}", e.Version, e.UpdateLocation, WixBA.Model.Version)); if (e.Version > WixBA.Model.Version) { WixBA.Model.Engine.SetUpdate(null, e.UpdateLocation, e.Size, UpdateHashType.None, null); this.UpdateVersion = String.Concat("v", e.Version.ToString()); string changesFormat = @"<body style='overflow: auto;'>{0}</body>"; this.UpdateChanges = String.Format(changesFormat, e.Content); this.State = UpdateState.Available; } else { this.State = UpdateState.Current; } e.StopProcessingUpdates = true; }