private void EnumRelatedFeatures(string productcode) { MsiError ret; StringBuilder featureParent = new StringBuilder(64); StringBuilder feature = new StringBuilder(64); uint i = 0; while ((ret = MsiInterop.MsiEnumFeatures(productcode, i, feature, featureParent)) == 0) { MsiInstallState installState = MsiInterop.MsiQueryFeatureState(productcode, feature.ToString()); if (installState == MsiInstallState.Local) { foreach (MsiFeature msiFeature in features) { if (msiFeature.Id == feature.ToString()) { msiFeature.SetIsAlreadyInstalled(true); } } } i++; } }
/// <summary>Blah</summary> public static uint ConfigureProduct( Guid ProductCode, MsiInstallLevel InstallLevel, MsiInstallState InstallState, string CommandLine) { return MsiConfigureProductEx("{" + ProductCode.ToString().ToUpper() + "}", (int)InstallLevel, (int)InstallState, CommandLine); }
public static extern MsiError MsiSetFeatureState(Int32 install, string feature, MsiInstallState state);
public static extern MsiError MsiSetComponentState(Int32 install, string component, MsiInstallState state);
public static extern MsiError MsiInstallMissingComponent(string product, string component, MsiInstallState state);
public static extern MsiError MsiGetFeatureState(Int32 install, string feature, out MsiInstallState state, out MsiInstallState action);
public static extern MsiError MsiGetFeatureCost(Int32 install, string feature, MsiCostTree costTree, MsiInstallState state, out int cost);
public static extern MsiError MsiGetComponentState(Int32 install, string component, out MsiInstallState state, out MsiInstallState action);
public static extern MsiError MsiEnumComponentCosts(Int32 install, string component, uint index, MsiInstallState state, string drive, ref uint driveSize, out int cost, out int tempCost);
public static extern MsiError MsiConfigureProductEx(string product, MsiInstallLevel level, MsiInstallState installState, string commandLine);
public static extern MsiError MsiConfigureProduct(string product, MsiInstallLevel level, MsiInstallState installState);
public static extern MsiError MsiConfigureFeature(string product, string feature, MsiInstallState installState);