/// <summary> /// Decompile the MsiLockPermissionsEx table. /// </summary> /// <param name="table">The table to decompile.</param> private void DecompileMsiLockPermissionsExTable(Table table) { foreach (Row row in table.Rows) { Wix.PermissionEx permissionEx = new Wix.PermissionEx(); permissionEx.Id = Convert.ToString(row[0]); permissionEx.Sddl = Convert.ToString(row[3]); if (null != row[4]) { Wix.Condition condition = new Wix.Condition(); condition.Content = Convert.ToString(row[4]); permissionEx.AddChild(condition); } switch (Convert.ToString(row[2])) { case "CreateFolder": case "File": case "Registry": case "ServiceInstall": break; default: this.core.OnMessage(WixWarnings.IllegalColumnValue(row.SourceLineNumbers, row.Table.Name, row.Fields[1].Column.Name, row[1])); return; } this.core.IndexElement(row, permissionEx); } }
/// <summary> /// Decompile the LaunchCondition table. /// </summary> /// <param name="table">The table to decompile.</param> private void DecompileLaunchConditionTable(Table table) { foreach (Row row in table.Rows) { if (Compiler.DowngradePreventedCondition == Convert.ToString(row[0]) || Compiler.UpgradePreventedCondition == Convert.ToString(row[0])) { continue; // MajorUpgrade rows processed in FinalizeUpgradeTable } Wix.Condition condition = new Wix.Condition(); condition.Content = Convert.ToString(row[0]); condition.Message = Convert.ToString(row[1]); this.core.RootElement.AddChild(condition); } }
/// <summary> /// Decompile the Component table. /// </summary> /// <param name="table">The table to decompile.</param> private void DecompileComponentTable(Table table) { foreach (Row row in table.Rows) { Wix.Component component = new Wix.Component(); component.Id = Convert.ToString(row[0]); component.Guid = Convert.ToString(row[1]); int attributes = Convert.ToInt32(row[3]); if (MsiInterop.MsidbComponentAttributesSourceOnly == (attributes & MsiInterop.MsidbComponentAttributesSourceOnly)) { component.Location = Wix.Component.LocationType.source; } else if (MsiInterop.MsidbComponentAttributesOptional == (attributes & MsiInterop.MsidbComponentAttributesOptional)) { component.Location = Wix.Component.LocationType.either; } if (MsiInterop.MsidbComponentAttributesSharedDllRefCount == (attributes & MsiInterop.MsidbComponentAttributesSharedDllRefCount)) { component.SharedDllRefCount = Wix.YesNoType.yes; } if (MsiInterop.MsidbComponentAttributesPermanent == (attributes & MsiInterop.MsidbComponentAttributesPermanent)) { component.Permanent = Wix.YesNoType.yes; } if (MsiInterop.MsidbComponentAttributesTransitive == (attributes & MsiInterop.MsidbComponentAttributesTransitive)) { component.Transitive = Wix.YesNoType.yes; } if (MsiInterop.MsidbComponentAttributesNeverOverwrite == (attributes & MsiInterop.MsidbComponentAttributesNeverOverwrite)) { component.NeverOverwrite = Wix.YesNoType.yes; } if (MsiInterop.MsidbComponentAttributes64bit == (attributes & MsiInterop.MsidbComponentAttributes64bit)) { component.Win64 = Wix.YesNoType.yes; } if (MsiInterop.MsidbComponentAttributesDisableRegistryReflection == (attributes & MsiInterop.MsidbComponentAttributesDisableRegistryReflection)) { component.DisableRegistryReflection = Wix.YesNoType.yes; } if (MsiInterop.MsidbComponentAttributesUninstallOnSupersedence == (attributes & MsiInterop.MsidbComponentAttributesUninstallOnSupersedence)) { component.UninstallWhenSuperseded = Wix.YesNoType.yes; } if (MsiInterop.MsidbComponentAttributesShared == (attributes & MsiInterop.MsidbComponentAttributesShared)) { component.Shared = Wix.YesNoType.yes; } if (null != row[4]) { Wix.Condition condition = new Wix.Condition(); condition.Content = Convert.ToString(row[4]); component.AddChild(condition); } Wix.Directory directory = (Wix.Directory)this.core.GetIndexedElement("Directory", Convert.ToString(row[2])); if (null != directory) { directory.AddChild(component); } else { this.core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerCore.PrimaryKeyDelimiter), "Directory_", Convert.ToString(row[2]), "Directory")); } this.core.IndexElement(row, component); } }
/// <summary> /// Decompile the Condition table. /// </summary> /// <param name="table">The table to decompile.</param> private void DecompileConditionTable(Table table) { foreach (Row row in table.Rows) { Wix.Condition condition = new Wix.Condition(); condition.Level = Convert.ToInt32(row[1]); if (null != row[2]) { condition.Content = Convert.ToString(row[2]); } Wix.Feature feature = (Wix.Feature)this.core.GetIndexedElement("Feature", Convert.ToString(row[0])); if (null != feature) { feature.AddChild(condition); } else { this.core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerCore.PrimaryKeyDelimiter), "Feature_", Convert.ToString(row[0]), "Feature")); } } }
/// <summary> /// Decompile the ControlCondition table. /// </summary> /// <param name="table">The table to decompile.</param> private void DecompileControlConditionTable(Table table) { foreach (Row row in table.Rows) { Wix.Condition condition = new Wix.Condition(); switch (Convert.ToString(row[2])) { case "Default": condition.Action = Wix.Condition.ActionType.@default; break; case "Disable": condition.Action = Wix.Condition.ActionType.disable; break; case "Enable": condition.Action = Wix.Condition.ActionType.enable; break; case "Hide": condition.Action = Wix.Condition.ActionType.hide; break; case "Show": condition.Action = Wix.Condition.ActionType.show; break; default: this.core.OnMessage(WixWarnings.IllegalColumnValue(row.SourceLineNumbers, table.Name, row.Fields[2].Column.Name, row[2])); break; } condition.Content = Convert.ToString(row[3]); Wix.Control control = (Wix.Control)this.core.GetIndexedElement("Control", Convert.ToString(row[0]), Convert.ToString(row[1])); if (null != control) { control.AddChild(condition); } else { this.core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerCore.PrimaryKeyDelimiter), "Dialog_", Convert.ToString(row[0]), "Control_", Convert.ToString(row[1]), "Control")); } } }