Ejemplo n.º 1
0
        /// <summary>Called when Windows Installer sends an installation message.</summary>
        /// <param name="args">The arguments of the event.</param>
        protected override void OnExecuteMsiMessage(Wix.ExecuteMsiMessageEventArgs args)
        {
            LogVerbose("Enter Method: OnExecuteMsiMessage");
            WPFBootstrapperEventArgs <Wix.ExecuteMsiMessageEventArgs> cancelArgs = new WPFBootstrapperEventArgs <Wix.ExecuteMsiMessageEventArgs>(args);

            TryInvoke(new Action(() => { _mainWindow.OnExecuteMsiMessage(cancelArgs); }));
            if (!cancelArgs.Cancel)
            {
                base.OnExecuteMsiMessage(cancelArgs.Arguments);
            }
            LogVerbose("Leaving Method: OnExecuteMsiMessage");
        }
Ejemplo n.º 2
0
        /// <summary>Called when Windows Installer sends an installation message.</summary>
        /// <param name="args">The arguments of the event.</param>
        protected override void OnExecuteMsiMessage(Wix.ExecuteMsiMessageEventArgs args)
        {
            this.LogBootstrapperEnterEvent(args, "ExecuteMsiMessage");
            WPFBootstrapperEventArgs <Wix.ExecuteMsiMessageEventArgs> cancelArgs = new WPFBootstrapperEventArgs <Wix.ExecuteMsiMessageEventArgs>(args);

            this.TryInvoke(new Action(() => { this.model.OnExecuteMsiMessage(cancelArgs); }));
            if (!cancelArgs.Cancel)
            {
                base.OnExecuteMsiMessage(cancelArgs.Arguments);
            }
            this.LogBootstrapperLeaveEvent(null, "ExecuteMsiMessage");
        }
        private void Bootstrapper_ExecuteMsiMessage(object sender, ExecuteMsiMessageEventArgs e)
        {
            if (e.Message != null &&
                e.MessageType == InstallMessage.Warning)
            {
                MessageId flag;
                var fields = e.Data.ToList();

                if (fields.Count >= 1
                    && Enum.TryParse(fields[0], out flag))
                {
                    switch (flag)
                    {
                        case MessageId.Progress:
                            if (fields.Count == 3)
                            {
                                this.Invoke((MethodInvoker)delegate
                                {
                                    int progress = 0;

                                    if (Int32.TryParse(fields[2], out progress))
                                    {
                                        this.label4.Text = fields[1];

                                        this.progress.Value = (int)((double)progress / (double)totalActions * 100.0);
                                    }
                                });
                            }
                            break;

                        case MessageId.MessageBox:
                            if (fields.Count == 2)
                            {
                                MessageBox.Show(this, fields[1]);
                            }
                            break;
                    }
                }
            }
        }
Ejemplo n.º 4
0
 private void ExecuteMsiMessage(object sender, ExecuteMsiMessageEventArgs e)
 {
     lock (this)
     {
         this.Message = e.Message;
         e.Result = this.root.Canceled ? Result.Cancel : Result.Ok;
     }
 }
		private void OnExecuteMsiMessage(object sender, ExecuteMsiMessageEventArgs e)
		{
			lock (_lock)
			{
				if (e.Data != null && e.Data.Count > 1 && !string.IsNullOrWhiteSpace(e.Data[1]))
				{
					ComponentMessage = e.Data[1];
				}

				if (e.MessageType == InstallMessage.ActionStart)
				{
					ComponentMessage = e.Message;
				}

				if (string.IsNullOrEmpty(ComponentMessage))
				{
					ComponentMessage = e.PackageId;
				}

				ComponentMessageAction = "Executing:";
				e.Result = _mainVmFactory.GetViewModelInstance().Cancelled ? Result.Cancel : Result.Ok;
			}
		}
Ejemplo n.º 6
0
        private void ExecuteMsiMessage(object sender, ExecuteMsiMessageEventArgs e)
        {
            lock (this)
            {
                if (e.MessageType == InstallMessage.ActionStart)
                {
                    this.Message = e.Message;
                }

                e.Result = this.root.Canceled ? Result.Cancel : Result.Ok;
            }
        }
Ejemplo n.º 7
0
        Result IBootstrapperApplication.OnExecuteMsiMessage(string wzPackageId, InstallMessage mt, int uiFlags, string wzMessage, int cData, string[] rgwzData, int nRecommendation)
        {
            ExecuteMsiMessageEventArgs args = new ExecuteMsiMessageEventArgs(wzPackageId, mt, uiFlags, wzMessage, rgwzData, nRecommendation);
            this.OnExecuteMsiMessage(args);

            return args.Result;
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Called when Windows Installer sends an installation message.
 /// </summary>
 /// <param name="args">Additional arguments for this event.</param>
 protected virtual void OnExecuteMsiMessage(ExecuteMsiMessageEventArgs args)
 {
     EventHandler<ExecuteMsiMessageEventArgs> handler = this.ExecuteMsiMessage;
     if (null != handler)
     {
         handler(this, args);
     }
 }
Ejemplo n.º 9
0
 void OnExecuteMessage(object sender, ExecuteMsiMessageEventArgs e)
 {
     string eMessage = string.Empty;
     switch (e.MessageType)
     {
         case InstallMessage.ActionStart:
             ActionStartMessage message = (ActionStartMessage)ParseMessage(e.Message, e.MessageType);
             ActionStartEventArgs eventArgs = new ActionStartEventArgs();
             eventArgs.DateRun = message.DateRun;
             eventArgs.Message = message.Message;
             eventArgs.Name = message.Name;
             eMessage = message.Name + ":" + message.Message;
             break;
         default:
             eMessage=e.Message;
             break;
     }
     this.Status = eMessage;
 }
 private void ExecuteMsiMessage(object sender, ExecuteMsiMessageEventArgs e)
 {
     lock (this)
     {
         if (e.Data.Count == 2 && e.Data[0] == "1") ExecuteMessage = string.Format("{0} {1}", CurrentAction, e.Data[1]);
         e.Result = _root.Canceled ? Result.Cancel : Result.Ok;
     }
 }