Hello and welcome to our forums,
Please note that it is not recommended to add a password protection for uninstalling the MSI package. The user should be able to uninstall any application from their own PC without any unnecessary barriers. Moreover, password protection for uninstalling could also cause issues such as locking the user out of their own PC or preventing them from performing necessary system maintenance. Instead, you can consider alternative solutions such as educating the end-users on the importance of not uninstalling the application or using a system management tool to restrict access to the uninstall process for users who do not have the necessary permissions.
You can add an
EditBox control on the
VerifyRemoveDlg dialog to prompt for the password to proceed. You can then condition the "Remove" button to be enabled only when the password entered is correct.
- uninstall password.png (121.14KiB)Viewed 12976 times
For this scenario you need to check the
"Use a single "Uninstall/Change" button" option from the
Product Details page. Also enable the
Enhanced User Interface to
"Always" from the
Themes page -->
Settings tab.
If you want to always require a password during uninstallation (uninstallation can be performed with basic UI and no dialogs will be displayed), then you will have to develop your own custom action which will implement the functionality and return an exit code different than 0 (zero) when the password is incorrect. The custom action should be added after "Install Execution Stage -> Searches" action group.
Please note that you can develop your custom action with the desired functionality in any programming language you want.
Hope this helps!
Best regards,
Liviu