I have an application installed. When I launch the shortcut for the first time, it goes for the self heal as this application contains user based files/registries.

But during the self healing process CANCEL button is enabled on the dialog for the user. How can i suppress this cancel button?

Attached the screen shot.

0 Comments   [ - ] Hide Comments


Please log in to comment

Community Chosen Answer



From my database of packaging stuff:

Hiding the CANCEL button

In some cases, it is desirable to disable the Cancel button.
For a Basic UI installation, the Cancel button can be disabled by
adding the exclamation point to the /qb switch, as in
msiexec /i product.msi /qb!.

Disabling the Cancel button for a full-UI installation requires a
custom action. The MsiProcessMessage function and Session.Message
method support constants that can suppress the Cancel button while
data transfer is taking place.
In a VBScript custom action, the code might appear as follows:

Function HideCancel( )

Const msiMessageTypeCommonData = &H0B000000

Set rec = Installer.CreateRecord(2)

rec.IntegerData(1) = 2
rec.IntegerData(2) = 0

Message msiMessageTypeCommonData, rec

HideCancel = 1 ' return success to MSI

End Function

Call this code in an immediate-mode custom action scheduled
in the Execute sequence after InstallInitialize,

For a reduced-UI or basic-UI installation, the Cancel button is
similarly hidden.

Code for an MSI DLL custom action that performs the same task might
appear as follows.

#pragma comment(lib, "msi.lib")

#include <windows.h>
#include <msi.h>
#include <msiquery.h>

UINT __stdcall HideCancelButton(MSIHANDLE hInstall)
    PMSIHANDLE hRecord = MsiCreateRecord(2);

    if (!hRecord)

    MsiRecordSetInteger(hRecord, 1, 2);
    MsiRecordSetInteger(hRecord, 2, 0);

    MsiProcessMessage(hInstall, INSTALLMESSAGE_COMMONDATA, hRecord);

    return ERROR_SUCCESS;

By default, because the custom action is called for first-time
installations and maintenance operations (including uninstallation),
the Cancel button will also be hidden during maintenance mode and
uninstallation. If you want control over the circumstances during
which the Cancel button is hidden, you can attach a condition to
the custom action. For example, to hide the Cancel button only
during uninstallation, you can use the condition REMOVE="ALL" in
the Execute sequence (somewhere after the InstallValidate action).

To re-display the Cancel button, you can use a similar custom action,
in which the second field of the record passed to Message or
MsiProcessMessage is set to 1 instead of 0.

For more information, see the Windows Installer Help Library topics
"MsiProcessMessage" and "Session.Message".

Answered 09/18/2013 by: EdT
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity



In Dialog Table you have a record for the dialog

maybe this is the "CancelSetup" dialog have you tried to change value
in Row Control_cancel(S50) from Cancel to No.

Answered 09/11/2013 by: Sweede
Second Degree Green Belt

  • No, no, no. No need to mess with tables, just add an exclamation mark to the command line argument for 'Basic UI', viz. "/QB!".
  • You are right VBScab! But here the scenario is, application is already installed and when i launch the shortcut first time it goes for self heal. We can't pass the command line parameters during launching shortcut right? So how to proceed here.
Please log in to comment

I dont think you can suppress the Cancel button that is seen during self-heal (after launching advertised shortcut). Alternavtively if you do not want the self heal to trigger on first launch you can include stubpath and do a /fud with /qn

Answered 09/11/2013 by: Sujit J
Blue Belt

  • Yea Sujit, this is very well known. But In my scenario, self heal should happen but without cancel button. thanks
Please log in to comment

I dont think the repair dialogs are easely editable. In fact when I looked at an MSI, all of the dialogs are associated with Install, Uninstall, Maintenance, or Patching. I do not see the Repair Dialog anywhere. This leads me to believe that its part of the backend process of MSIEXEC.

Most of the times when we want to keep a user from seeing this dialog, is to figure out what is trying to be repaired, and get it fixed before it has a chance to run. Either by Installing a Key, or File at InstallTime, or by doing something with Active Setup and handling it during login process. (this option will NOT be cancelable by the user).

The downside to trying to take away the cancel button from repair is, what happens if a process gets into a loop, and the repair trys to happen every time a shortcut is run?

So my opinion is to do what Sujit suggested and control the Repair via Active setup, then you can pass /qb! (no cancel) or /qn (no Dialog).

Answered 09/11/2013 by: ekgcorp
Tenth Degree Black Belt

  • Thank you Suji and ekgcorp :)
Please log in to comment