Cancel button during Self healing/Self repair of msi.
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.
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
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
Code for an MSI DLL custom action that performs the same task might
appear as follows.
#pragma comment(lib, "msi.lib")
UINT __stdcall HideCancelButton(MSIHANDLE hInstall)
PMSIHANDLE hRecord = MsiCreateRecord(2);
MsiRecordSetInteger(hRecord, 1, 2);
MsiRecordSetInteger(hRecord, 2, 0);
MsiProcessMessage(hInstall, INSTALLMESSAGE_COMMONDATA, hRecord);
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".