/// <summary> /// Decompile the MoveFile table. /// </summary> /// <param name="table">The table to decompile.</param> private void DecompileMoveFileTable(Table table) { foreach (Row row in table.Rows) { Wix.CopyFile copyFile = new Wix.CopyFile(); copyFile.Id = Convert.ToString(row[0]); if (null != row[2]) { copyFile.SourceName = Convert.ToString(row[2]); } if (null != row[3]) { string[] names = Installer.GetNames(Convert.ToString(row[3])); if (null != names[0] && null != names[1]) { copyFile.DestinationShortName = names[0]; copyFile.DestinationName = names[1]; } else if (null != names[0]) { copyFile.DestinationName = names[0]; } } // source/destination directory/property is set in FinalizeDuplicateMoveFileTables switch (Convert.ToInt32(row[6])) { case 0: break; case MsiInterop.MsidbMoveFileOptionsMove: copyFile.Delete = Wix.YesNoType.yes; break; default: this.core.OnMessage(WixWarnings.IllegalColumnValue(row.SourceLineNumbers, table.Name, row.Fields[6].Column.Name, row[6])); break; } Wix.Component component = (Wix.Component)this.core.GetIndexedElement("Component", Convert.ToString(row[1])); if (null != component) { component.AddChild(copyFile); } else { this.core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerCore.PrimaryKeyDelimiter), "Component_", Convert.ToString(row[1]), "Component")); } this.core.IndexElement(row, copyFile); } }
/// <summary> /// Decompile the DuplicateFile table. /// </summary> /// <param name="table">The table to decompile.</param> private void DecompileDuplicateFileTable(Table table) { foreach (Row row in table.Rows) { Wix.CopyFile copyFile = new Wix.CopyFile(); copyFile.Id = Convert.ToString(row[0]); copyFile.FileId = Convert.ToString(row[2]); if (null != row[3]) { string[] names = Installer.GetNames(Convert.ToString(row[3])); if (null != names[0] && null != names[1]) { copyFile.DestinationShortName = names[0]; copyFile.DestinationName = names[1]; } else if (null != names[0]) { copyFile.DestinationName = names[0]; } } // destination directory/property is set in FinalizeDuplicateMoveFileTables Wix.Component component = (Wix.Component)this.core.GetIndexedElement("Component", Convert.ToString(row[1])); if (null != component) { component.AddChild(copyFile); } else { this.core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerCore.PrimaryKeyDelimiter), "Component_", Convert.ToString(row[1]), "Component")); } this.core.IndexElement(row, copyFile); } }