private void T(String id, String ver, String product, String url) { INSTALLSTATE ist = MsiQueryProductState(id); ListViewItem lvi = new ListViewItem(product); lvi.SubItems.Add((ver ?? "").TrimEnd('?')); lvi.SubItems.Add(id); lvi.SubItems.Add(ist.ToString()); if (url != null) { lvi.SubItems.Add(url); } switch (ist) { case INSTALLSTATE.Default: lvi.ImageKey = "Y"; lvi.Font = new Font(lvi.Font, FontStyle.Bold); lvi.BackColor = Color.FromKnownColor(KnownColor.Info); lvi.ForeColor = Color.FromKnownColor(KnownColor.InfoText); break; default: lvi.ImageKey = "N"; break; } lvR.Items.Add(lvi); }
static private string InstallStateString(INSTALLSTATE installState) { string state; switch (installState) { case INSTALLSTATE.INSTALLSTATE_NOTUSED: state = "Disabled"; break; case INSTALLSTATE.INSTALLSTATE_BADCONFIG: state = "Corrupt"; break; case INSTALLSTATE.INSTALLSTATE_INCOMPLETE: state = "Incomplete"; break; case INSTALLSTATE.INSTALLSTATE_SOURCEABSENT: state = "Absent"; break; case INSTALLSTATE.INSTALLSTATE_MOREDATA: state = "Buffer Overflow"; break; case INSTALLSTATE.INSTALLSTATE_INVALIDARG: state = "Invalid"; break; case INSTALLSTATE.INSTALLSTATE_UNKNOWN: state = "Unknown"; break; case INSTALLSTATE.INSTALLSTATE_BROKEN: state = "Broken"; break; case INSTALLSTATE.INSTALLSTATE_ADVERTISED: state = "Advertised"; break; case INSTALLSTATE.INSTALLSTATE_ABSENT: state = "Absent"; break; case INSTALLSTATE.INSTALLSTATE_LOCAL: state = "Local"; break; case INSTALLSTATE.INSTALLSTATE_SOURCE: state = "Source"; break; case INSTALLSTATE.INSTALLSTATE_DEFAULT: state = "Installed"; break; default: state = installState.ToString(); break; } return(state); }
private static string InstallStateString(INSTALLSTATE installState) { string state; switch (installState) { case INSTALLSTATE.INSTALLSTATE_NOTUSED: state = "Disabled"; break; case INSTALLSTATE.INSTALLSTATE_BADCONFIG: state = "Corrupt"; break; case INSTALLSTATE.INSTALLSTATE_INCOMPLETE: state = "Incomplete"; break; case INSTALLSTATE.INSTALLSTATE_SOURCEABSENT: state = "Absent"; break; case INSTALLSTATE.INSTALLSTATE_MOREDATA: state = "Buffer Overflow"; break; case INSTALLSTATE.INSTALLSTATE_INVALIDARG: state = "Invalid"; break; case INSTALLSTATE.INSTALLSTATE_UNKNOWN: state = "Unknown"; break; case INSTALLSTATE.INSTALLSTATE_BROKEN: state = "Broken"; break; case INSTALLSTATE.INSTALLSTATE_ADVERTISED: state = "Advertised"; break; case INSTALLSTATE.INSTALLSTATE_ABSENT: state = "Absent"; break; case INSTALLSTATE.INSTALLSTATE_LOCAL: state = "Local"; break; case INSTALLSTATE.INSTALLSTATE_SOURCE: state = "Source"; break; case INSTALLSTATE.INSTALLSTATE_DEFAULT: state = "Installed"; break; default: state = installState.ToString(); break; } return state; }