Summary
How to hide the cancel button on the MSI Progress DialogSynopsis
This article discusses various techniques for hiding the Cancel button on the various progress dialog boxes displayed by a Windows Installer (Basic MSI) installation.Discussion
Default Progress Dialog BoxesWhile a Windows Installer installation makes changes to a target system, by default it displays feedback to the user on a progress dialog box. For a full-user interface installation or uninstallation, the SetupProgress dialog box is displayed.
For a Basic UI installation?one performed by running the command msiexec /i product.msi /qb or by launching an uninstallation from the Remove button on the Add or Remove Programs tool?a smaller progress dialog box similar to the following is displayed:
In both cases, the progress dialog displays a Cancel button, with which the user can exit the installation. If the installation is running in deferred mode, any rollback actions contained in the execution script will be performed.
Disabling 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!. In this case, the progress dialog box appears as follows.
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
If you call this code in an immediate-mode custom action scheduled in the Execute sequence after InstallInitialize, the SetupProgress dialog box appears as follows.
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). For more information about this type of condition, see "Conditions to Determine Installation States".
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".
Was this helpful?
Related Articles
InstallScript MSI Progress Dialog Status Text Overlap 4Number of Views How To Disable The 'X'/'Cancel' Button Of A Dialog 6Number of Views Known Issue: Red bar error may be shown in the UI when a user without administrator rights clicks the Cancel button after … 4Number of Views Unable to Change the Font Used for the Cancel Installation Dialog 4Number of Views How to change the color of standard installation progress dialog 3Number of Views
Revenera Assistant
Online
Hi, I am Reva - Ask me anything.
Updates
No new updates
Chat
Home
Updates
/**/
Thanks for the feedback!
Your feedback has been saved.Rate this response:
1
2
3
4
5
Add Additional feedback ( Optional )
0/240
English
English
Language changed successfully
Something went wrong
Email sent successfully
Something went wrong
Case create successfully
Are you sure you want to cancel
the case creation?
Please select a product to submit the case.
Please select a product version to submit the case.
0/255
Upload Attachment
File Upload
Maximum file
size allowed is 3 MB.
File type
not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
Are you sure you want to cancel the case creation?
Case closed successfully
File Upload
Maximum file size allowed is 3 MB.
File type not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
File Upload
Maximum file
size allowed is 3 MB.
File type
not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
© 2026 Flexera Software. All Rights Reserved.
Case id: 00001065
Activity: Status change: 2 hours ago