Ejemplo n.º 1
0
        public void CreateTransformSummaryInfo(
            Database referenceDatabase,
            string transformFile,
            TransformErrors errors,
            TransformValidations validations)
        {
            if (referenceDatabase == null)
            {
                throw new ArgumentNullException("referenceDatabase");
            }

            if (String.IsNullOrEmpty(transformFile))
            {
                throw new ArgumentNullException("transformFile");
            }

            uint ret = NativeMethods.MsiCreateTransformSummaryInfo(
                (int)this.Handle,
                (int)referenceDatabase.Handle,
                transformFile,
                (int)errors,
                (int)validations);

            if (ret != 0)
            {
                throw InstallerException.ExceptionFromReturnCode(ret);
            }
        }
Ejemplo n.º 2
0
 internal static extern int MsiCreateTransformSummaryInfo(uint database, uint referenceDatabase, string transformFile, TransformErrorConditions errorConditions, TransformValidations validations);
Ejemplo n.º 3
0
 /// <summary>
 /// Creates and populates the summary information stream of an existing transform file.
 /// </summary>
 /// <param name="referenceDatabase">Required database that does not include the changes.</param>
 /// <param name="transformFile">The name of the generated transform file.</param>
 /// <param name="errorConditions">Required error conditions that should be suppressed when the transform is applied.</param>
 /// <param name="validations">Required when the transform is applied to a database;
 /// shows which properties should be validated to verify that this transform can be applied to the database.</param>
 public void CreateTransformSummaryInfo(Database referenceDatabase, string transformFile, TransformErrorConditions errorConditions, TransformValidations validations)
 {
     int error = MsiInterop.MsiCreateTransformSummaryInfo(this.Handle, referenceDatabase.Handle, transformFile, errorConditions, validations);
     if (0 != error)
     {
         throw new MsiException(error);
     }
 }
Ejemplo n.º 4
0
 internal static extern int MsiCreateTransformSummaryInfo(uint database, uint referenceDatabase, string transformFile, TransformErrorConditions errorConditions, TransformValidations validations);
Ejemplo n.º 5
0
        /// <summary>
        /// Creates and populates the summary information stream of an existing transform file.
        /// </summary>
        /// <param name="referenceDatabase">Required database that does not include the changes.</param>
        /// <param name="transformFile">The name of the generated transform file.</param>
        /// <param name="errorConditions">Required error conditions that should be suppressed when the transform is applied.</param>
        /// <param name="validations">Required when the transform is applied to a database;
        /// shows which properties should be validated to verify that this transform can be applied to the database.</param>
        public void CreateTransformSummaryInfo(Database referenceDatabase, string transformFile, TransformErrorConditions errorConditions, TransformValidations validations)
        {
            int error = MsiInterop.MsiCreateTransformSummaryInfo(this.Handle, referenceDatabase.Handle, transformFile, errorConditions, validations);

            if (0 != error)
            {
                throw new MsiException(error);
            }
        }
Ejemplo n.º 6
0
        private void DecodeSummaryInfo(SummaryInfo transformSummaryInfo)
        {
            try
            {
                string[] rev = transformSummaryInfo.RevisionNumber.Split(new char[] { ';' }, 3);
                this.targetProductCode = rev[0].Substring(0, 38);
                this.targetProductVersion = rev[0].Substring(38);
                this.upgradeProductCode = rev[1].Substring(0, 38);
                this.upgradeProductVersion = rev[1].Substring(38);
                this.upgradeCode = rev[2];

                string[] templ = transformSummaryInfo.Template.Split(new Char[] { ';' }, 2);
                this.targetPlatform = templ[0];
                this.targetLanguage = 0;
                if (templ.Length >= 2 && templ[1].Length > 0)
                {
                    this.targetLanguage = Int32.Parse(templ[1], CultureInfo.InvariantCulture.NumberFormat);
                }

                this.validateFlags = (TransformValidations) transformSummaryInfo.CharacterCount;
            }
            catch (Exception ex)
            {
                throw new InstallerException("Invalid transform summary info", ex);
            }
        }
Ejemplo n.º 7
0
        public void CreateTransformSummaryInfo(
            Database referenceDatabase,
            string transformFile,
            TransformErrors errors,
            TransformValidations validations)
        {
            if (referenceDatabase == null)
            {
                throw new ArgumentNullException("referenceDatabase");
            }

            if (string.IsNullOrWhiteSpace(transformFile))
            {
                throw new ArgumentNullException("transformFile");
            }

            uint ret = NativeMethods.MsiCreateTransformSummaryInfo(
                (int) this.Handle,
                (int) referenceDatabase.Handle,
                transformFile,
                (int) errors,
                (int) validations);
            if (ret != 0)
            {
                throw InstallerException.ExceptionFromReturnCode(ret);
            }
        }