예제 #1
0
 private void SendInstallerMessageReceived(InstallerMessage installerMessage, bool needsUserAction)
 {
     if (installerMessage != null && InstallerMessageReceived != null)
     {
         this.userActed = false;
         InstallerMessageEventArgs args = new InstallerMessageEventArgs(installerMessage, needsUserAction);
         InstallerMessageReceived(this, args);
     }
 }
예제 #2
0
 internal InstallerMessageEventArgs(InstallerMessage installerMessage, bool setUserAction)
 {
     this.installerMessage = installerMessage;
     this.setUserAction    = setUserAction;
 }
예제 #3
0
 internal void SetMessage(InstallerMessage message)
 {
     this.installerMessage = message;
 }
예제 #4
0
 private void SendInstallerMessageReceived(InstallerMessage installerMessage)
 {
     SendInstallerMessageReceived(installerMessage, false);
 }
예제 #5
0
        //1: 2 2: 25 3: 0 4: 1
        private bool Process_Progress_Message(string message)
        {
            string[] progressItems = message.Split(": ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            if (progressItems == null || progressItems.Length == 0 || progressItems[0] == null)
            {
                Application.DoEvents();
            }

            List <string> fields = new List <string>();

            for (int i = 0; i < progressItems.Length; i++)
            {
                if (i % 2 == 1)
                {
                    fields.Add(progressItems[i]);
                }
            }

            if (fields.Count == 0)
            {
                return(false);
            }

            //http://msdn.microsoft.com/en-us/library/aa370573%28VS.85%29.aspx
            InstallerMessage progressMessage = null;

            switch (fields[0])
            {
            case "0":
                ResetMessage resetMessage = new ResetMessage();
                if (fields.Count > 1)
                {
                    resetMessage.SetTicks(Int32.Parse(fields[1]));
                }
                if (fields.Count > 2)
                {
                    if (fields[2] == "0")
                    {
                        resetMessage.SetDirection(ProgressDirection.Forward);
                    }
                    else
                    {
                        resetMessage.SetDirection(ProgressDirection.Backward);
                    }
                }
                if (fields.Count > 3)
                {
                    if (fields[3] == "0")
                    {
                        resetMessage.SetIsApproximate(false);
                    }
                    else if (fields[3] == "1")
                    {
                        resetMessage.SetIsApproximate(true);
                    }
                }

                progressMessage = resetMessage;
                break;

            case "1":
                //ActionInfoMessage actionInfoMessage = new ActionInfoMessage();
                //if (fields.Count > 1) {
                //  actionInfoMessage.SetTicksPerActionData(Int32.Parse(fields[1]));
                //}
                //if (fields.Count > 2) {
                //  if (fields[2] == "0")
                //    actionInfoMessage.SetIgnoreTicksPerActionData(true);
                //  else
                //    actionInfoMessage.SetIgnoreTicksPerActionData(false);
                //}

                //progressMessage = actionInfoMessage;
                break;

            case "2":
                ProgressReportMessage progressReportMessage = new ProgressReportMessage();
                if (fields.Count > 1)
                {
                    progressReportMessage.SetTicksMoved(Int32.Parse(fields[1]));
                }

                progressMessage = progressReportMessage;
                break;

            case "3":
                //ProgressAdditionMessage progressAddition = new ProgressAdditionMessage();
                //if (fields.Count > 1) {
                //  progressAddition.SetTicks(Int32.Parse(fields[1]));
                //}

                //progressMessage = progressAddition;
                break;

            default: break;
            }

            SendInstallerMessageReceived(progressMessage);

            return(true);
        }