Create a custom action.
[DllImport("kernel32")]
static extern IntPtr LoadLibrary(string file);
[CustomAction]
public static ActionResult CheckIfMsmqIsInstalled()
{
IntPtr handle = LoadLibrary("Mqrt.dll");
if (handle == IntPtr.Zero || handle.ToInt32() == 0)
{
var msg = String.Format("MSMQ is not installed");
MessageBox.Show(msg, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return ActionResult.Success;
}
return ActionResult.Success;
}
Register it in your CustomActions.wxs
<CustomAction Id="CheckIfMsmqIsInstalled"
BinaryKey="CustomActions"
DllEntry="CheckIfMsmqIsInstalled" Return="check" Execute="immediate" Impersonate="no"> </CustomAction>
source
share