/build/static/layout/Breadcrumb_cap_w.png

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.


0 Comments   [ + ] Show comments

Answers (4)

Posted by: EdT 10 years ago
Red Belt
1

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)
        return ERROR_INSTALL_FAILURE;

    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".

Posted by: Sweede 10 years ago
Second Degree Green Belt
0

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.
 


Comments:
  • No, no, no. No need to mess with tables, just add an exclamation mark to the command line argument for 'Basic UI', viz. "/QB!". - anonymous_9363 10 years ago
  • 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. - rvprasad 10 years ago
Posted by: Sujit J 10 years ago
Blue Belt
0

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


Comments:
  • Yea Sujit, this is very well known. But In my scenario, self heal should happen but without cancel button. thanks - rvprasad 10 years ago
Posted by: ekgcorp 10 years ago
10th Degree Black Belt
0

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).


Comments:
  • Thank you Suji and ekgcorp :) - rvprasad 10 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ