Esempio n. 1
0
        /// <summary>
        /// Adds the PatchFiles action to the sequence table if it does not already exist.
        /// </summary>
        /// <param name="table">The sequence table to check or modify.</param>
        /// <param name="mainTransform">The primary authoring transform.</param>
        /// <param name="pairedTransform">The secondary patch transform.</param>
        /// <param name="mainFileRow">The file row that contains information about the patched file.</param>
        private void AddPatchFilesActionToSequenceTable(SequenceTable table, Output mainTransform, Output pairedTransform, Row mainFileRow)
        {
            // Find/add PatchFiles action (also determine sequence for it).
            // Search mainTransform first, then pairedTransform (pairedTransform overrides).
            bool   hasPatchFilesAction = false;
            int    seqInstallFiles     = 0;
            int    seqDuplicateFiles   = 0;
            string tableName           = table.ToString();

            TestSequenceTableForPatchFilesAction(
                mainTransform.Tables[tableName],
                ref hasPatchFilesAction,
                ref seqInstallFiles,
                ref seqDuplicateFiles);
            TestSequenceTableForPatchFilesAction(
                pairedTransform.Tables[tableName],
                ref hasPatchFilesAction,
                ref seqInstallFiles,
                ref seqDuplicateFiles);
            if (!hasPatchFilesAction)
            {
                Table iesTable = pairedTransform.EnsureTable(this.TableDefinitions[tableName]);
                if (0 == iesTable.Rows.Count)
                {
                    iesTable.Operation = TableOperation.Add;
                }

                Row          patchAction    = iesTable.CreateRow(null);
                WixActionRow wixPatchAction = WindowsInstallerStandardInternal.GetStandardActionRows()[table, "PatchFiles"];
                int          sequence       = wixPatchAction.Sequence;
                // Test for default sequence value's appropriateness
                if (seqInstallFiles >= sequence || (0 != seqDuplicateFiles && seqDuplicateFiles <= sequence))
                {
                    if (0 != seqDuplicateFiles)
                    {
                        if (seqDuplicateFiles < seqInstallFiles)
                        {
                            throw new WixException(ErrorMessages.InsertInvalidSequenceActionOrder(mainFileRow.SourceLineNumbers, iesTable.Name, "InstallFiles", "DuplicateFiles", wixPatchAction.Action));
                        }
                        else
                        {
                            sequence = (seqDuplicateFiles + seqInstallFiles) / 2;
                            if (seqInstallFiles == sequence || seqDuplicateFiles == sequence)
                            {
                                throw new WixException(ErrorMessages.InsertSequenceNoSpace(mainFileRow.SourceLineNumbers, iesTable.Name, "InstallFiles", "DuplicateFiles", wixPatchAction.Action));
                            }
                        }
                    }
                    else
                    {
                        sequence = seqInstallFiles + 1;
                    }
                }
                patchAction[0]        = wixPatchAction.Action;
                patchAction[1]        = wixPatchAction.Condition;
                patchAction[2]        = sequence;
                patchAction.Operation = RowOperation.Add;
            }
        }
        public UnbindTransformCommand(IMessaging messaging, string transformFile, string exportBasePath, string intermediateFolder)
        {
            this.Messaging          = messaging;
            this.TransformFile      = transformFile;
            this.ExportBasePath     = exportBasePath;
            this.IntermediateFolder = intermediateFolder;

            this.TableDefinitions = WindowsInstallerStandardInternal.GetTableDefinitions();
        }
Esempio n. 3
0
        public UnbindDatabaseCommand(IMessaging messaging, Database database, string databasePath, OutputType outputType, string exportBasePath, string intermediateFolder, bool isAdminImage, bool suppressDemodularization, bool skipSummaryInfo)
        {
            this.Messaging                = messaging;
            this.Database                 = database;
            this.DatabasePath             = databasePath;
            this.OutputType               = outputType;
            this.ExportBasePath           = exportBasePath;
            this.IntermediateFolder       = intermediateFolder;
            this.IsAdminImage             = isAdminImage;
            this.SuppressDemodularization = suppressDemodularization;
            this.SkipSummaryInfo          = skipSummaryInfo;

            this.TableDefinitions = WindowsInstallerStandardInternal.GetTableDefinitions();
        }
Esempio n. 4
0
        public BindDatabaseCommand(IBindContext context, IEnumerable <IWindowsInstallerBackendExtension> backendExtension, Validator validator)
        {
            this.TableDefinitions = WindowsInstallerStandardInternal.GetTableDefinitions();

            this.CabbingThreadCount      = context.CabbingThreadCount;
            this.CabCachePath            = context.CabCachePath;
            this.Codepage                = context.Codepage;
            this.DefaultCompressionLevel = context.DefaultCompressionLevel;
            this.DelayedFields           = context.DelayedFields;
            this.ExpectedEmbeddedFiles   = context.ExpectedEmbeddedFiles;
            this.FileSystemExtensions    = context.FileSystemExtensions;
            this.Intermediate            = context.IntermediateRepresentation;
            this.Messaging               = context.Messaging;
            this.OutputPath              = context.OutputPath;
            this.IntermediateFolder      = context.IntermediateFolder;
            this.Validator               = validator;

            this.BackendExtensions = backendExtension;
        }
Esempio n. 5
0
 public InscribeMsiPackageCommand(IInscribeContext context)
 {
     this.Context          = context;
     this.Messaging        = context.ServiceProvider.GetService <IMessaging>();
     this.TableDefinitions = WindowsInstallerStandardInternal.GetTableDefinitions();
 }
Esempio n. 6
0
 public InscribeMsiPackageCommand(IInscribeContext context)
 {
     this.Context          = context;
     this.TableDefinitions = WindowsInstallerStandardInternal.GetTableDefinitions();
 }