private void DisplayResult(uint resultCode) { if (MsiProduct.IsSuccess(resultCode)) { if (MsiProduct.IsRebootNeeded(resultCode)) { txtBxResult.Text = _localization.GetLocalizedString("SuccessPendingReboot"); } else { txtBxResult.Text = _localization.GetLocalizedString("Success"); } txtBxResult.BackColor = Color.LightGreen; } else { txtBxResult.Text = _localization.GetLocalizedString("Failed") + "(" + resultCode.ToString() + ") : " + MsiProduct.GetErrorMessage(resultCode); txtBxResult.BackColor = Color.Orange; } txtBxResult.Refresh(); }
private void ReportUninstallResult(uint resultCode, DataGridViewRow row, MsiProduct uninstalledProduct) { row.Cells["ResultCode"].Value = resultCode; if (MsiProduct.IsSuccess(resultCode)) { txtBxMessage.BackColor = Color.LightGreen; if (MsiProduct.IsRebootNeeded(resultCode)) { row.Cells["Result"].Value = _localization.GetLocalizedString("SuccessPendingReboot"); row.Cells["Result"].Style = _successRebootStyle; txtBxMessage.Text = _localization.GetLocalizedString("SuccessPendingReboot"); if (!UninstalledProducts.Contains(uninstalledProduct)) { UninstalledProducts.Add(uninstalledProduct); } } else { row.Cells["Result"].Value = _localization.GetLocalizedString("Success"); row.Cells["Result"].Style = _successStyle; txtBxMessage.Text = _localization.GetLocalizedString("Success"); if (!UninstalledProducts.Contains(uninstalledProduct)) { UninstalledProducts.Add(uninstalledProduct); } } } else { txtBxMessage.BackColor = Color.Orange; row.Cells["Result"].Value = _localization.GetLocalizedString("Failed") + "(" + resultCode + ")"; row.Cells["Result"].Style = _failedStyle; txtBxMessage.Text = MsiProduct.GetErrorMessage(resultCode); } }