Beispiel #1
0
        /// <summary>Called by the engine to allow the user experience to change the source using <see cref="M:Engine.SetLocalSource"/> or <see cref="M:Engine.SetDownloadSource"/>.</summary>
        /// <param name="args">The arguments of the event.</param>
        protected override void OnResolveSource(Wix.ResolveSourceEventArgs args)
        {
            LogVerbose("Enter Method: OnResolveSource");
            WPFBootstrapperEventArgs <Wix.ResolveSourceEventArgs> cancelArgs = new WPFBootstrapperEventArgs <Wix.ResolveSourceEventArgs>(args);

            TryInvoke(new Action(() => { _mainWindow.OnResolveSource(cancelArgs); }));
            if (!cancelArgs.Cancel)
            {
                args.Result = !string.IsNullOrEmpty(args.DownloadSource) ? Wix.Result.Download : Wix.Result.Ok;
                base.OnResolveSource(cancelArgs.Arguments);
            }
            LogVerbose("Leaving Method: OnResolveSource");
        }
        /// <summary>Called by the engine to allow the user experience to change the source using <see cref="M:Engine.SetLocalSource"/> or <see cref="M:Engine.SetDownloadSource"/>.</summary>
        /// <param name="args">The arguments of the event.</param>
        protected override void OnResolveSource(Wix.ResolveSourceEventArgs args)
        {
            this.LogBootstrapperEnterEvent(args, "ResolveSource");
            WPFBootstrapperEventArgs <Wix.ResolveSourceEventArgs> cancelArgs = new WPFBootstrapperEventArgs <Wix.ResolveSourceEventArgs>(args);

            this.TryInvoke(new Action(() => { this.model.OnResolveSource(cancelArgs); }));
            if (!cancelArgs.Cancel)
            {
                args.Result = !string.IsNullOrEmpty(args.DownloadSource) ? Wix.Result.Download : Wix.Result.Ok;
                base.OnResolveSource(cancelArgs.Arguments);
            }
            this.LogBootstrapperLeaveEvent(null, "ResolveSource");
        }
		void ResolveSource(object sender, ResolveSourceEventArgs e)
		{
			int retries = 0;

			_downloadRetries.TryGetValue(e.PackageOrContainerId, out retries);
			_downloadRetries[e.PackageOrContainerId] = retries + 1;

			e.Result = retries < 3 && !String.IsNullOrEmpty(e.DownloadSource) ? Result.Download : Result.Ok;
		}
Beispiel #4
0
        private void ResolveSource(object sender, ResolveSourceEventArgs e)
        {
            Logger.Standard("Resolve source request received");
            Logger.Standard("download source: {0}", e.DownloadSource);
            Logger.Standard("local source: {0}", e.LocalSource);
            Logger.Standard("package id: {0}", e.PackageOrContainerId);
            Logger.Standard("payload id: {0}", e.PayloadId);

            if (!_resolvePrompt)
            {
                Logger.Standard("Attempting to find local source");
                BaseModel.SetLocalSource(e.PackageOrContainerId, e.PayloadId, FindSource(e.LocalSource));
                _resolvePrompt = true;
                e.Result = Result.Retry;
            }
            else
            {
                e.Result = Result.Error;
            }
        }
Beispiel #5
0
        Result IBootstrapperApplication.OnResolveSource(string wzPackageOrContainerId, string wzPayloadId, string wzLocalSource, string wzDownloadSource)
        {
            ResolveSourceEventArgs args = new ResolveSourceEventArgs(wzPackageOrContainerId, wzPayloadId, wzLocalSource, wzDownloadSource);
            this.OnResolveSource(args);

            return args.Result;
        }
Beispiel #6
0
 /// <summary>
 /// Called by the engine to allow the user experience to change the source
 /// using <see cref="M:Engine.SetLocalSource"/> or <see cref="M:Engine.SetDownloadSource"/>.
 /// </summary>
 /// <param name="args">Additional arguments for this event.</param>
 protected virtual void OnResolveSource(ResolveSourceEventArgs args)
 {
     EventHandler<ResolveSourceEventArgs> handler = this.ResolveSource;
     if (null != handler)
     {
         handler(this, args);
     }
 }
		private void OnResolveSource(object sender, ResolveSourceEventArgs e)
		{
			e.Result = !string.IsNullOrEmpty(e.DownloadSource) ? Result.Download : Result.Ok;
		}
        private void ResolveSource(object sender, ResolveSourceEventArgs e)
        {
            //Bootstrapper.Model.Bootstrapper.Engine.Log(LogLevel.Verbose, string.Format("Entering ResolveSource. DownloadSource: {0} LocalSource: {1}", e.DownloadSource, e.LocalSource));
            int retries;

            _downloadRetries.TryGetValue(e.PackageOrContainerId, out retries);
            _downloadRetries[e.PackageOrContainerId] = retries + 1;
            e.Result = retries < 3 && !String.IsNullOrEmpty(e.DownloadSource) ? Result.Download : Result.Ok;
            if (e.Result == Result.Download) Message = "Downloading " + e.PackageOrContainerId;
            else Message = "Caching " + e.PackageOrContainerId;
            //Bootstrapper.Model.Bootstrapper.Engine.Log(LogLevel.Verbose, string.Format("Leaving ResolveSource. DownloadSource: {0} LocalSource: {1}", e.DownloadSource, e.LocalSource));
        }