Esempio n. 1
0
        private MessageResult OnInformation(Deployment.WindowsInstaller.Record record)
        {
            if (null != record)
            {
                string message = record.ToString();
                if (!string.IsNullOrEmpty(message))
                {
                    var ice = new IceMessage(message);
                    var obj = PSObject.AsPSObject(ice);

                    if (!string.IsNullOrEmpty(this.CurrentPath))
                    {
                        ice.Path = this.CurrentPath;

                        // Set the PSPath for cmdlets that would use it.
                        string path = this.SessionState.Path.GetUnresolvedPSPathFromProviderPath(this.CurrentPath);
                        obj.SetPropertyValue <string>("PSPath", path);
                    }

                    var data = new Data(DataType.Information, obj);
                    this.Output.Enqueue(data);
                }
            }

            return(MessageResult.OK);
        }
Esempio n. 2
0
        /// <summary>
        /// Called when an action sends more information.
        /// </summary>
        /// <param name="record">The <see cref="Deployment.WindowsInstaller.Record"/> containing additional information.</param>
        /// <returns>The result code indicating how Windows Installer should proceed.</returns>
        protected MessageResult OnActionData(Deployment.WindowsInstaller.Record record)
        {
            if (this.progress.IsValid)
            {
                // Step the current progress completed.
                var current = this.progress.Current;

                if (current.EnableActionData)
                {
                    if (current.Forward)
                    {
                        current.Complete += current.Step;
                    }
                    else
                    {
                        current.Complete -= current.Step;
                    }
                }

                // Set the current action message when executing the script.
                if (null != record && !current.GeneratingScript)
                {
                    if (!string.IsNullOrEmpty(this.progress.CurrentActionTemplate))
                    {
                        record.FormatString = this.progress.CurrentActionTemplate;
                    }

                    this.progress.CurrentActionDetail = record.ToString();
                }

                this.WriteProgress();
            }

            return(MessageResult.OK);
        }
Esempio n. 3
0
        /// <summary>
        /// Writes a verbose message to the pipeline.
        /// </summary>
        /// <param name="record">The <see cref="Deployment.WindowsInstaller.Record"/> containing the verbose message details.</param>
        /// <returns>The result code indicating how Windows Installer should proceed.</returns>
        protected MessageResult OnVerbose(Deployment.WindowsInstaller.Record record)
        {
            if (null != record)
            {
                string message = record.ToString();
                this.WriteVerbose(message);
            }

            return(MessageResult.OK);
        }
Esempio n. 4
0
        private MessageResult OnWarning(Deployment.WindowsInstaller.Record record)
        {
            if (null != record)
            {
                string message = record.ToString();

                var data = new Data(DataType.Warning, message);
                this.Output.Enqueue(data);
            }

            return(MessageResult.OK);
        }