By using custom actions (MSI Installer) how to stop proessing of MSI Installer.(VS2005 Setup Project)
Hello
I have creating an MSI Installer and writing custom actions in it.
As per the requirement while uninstallation I have check some conditions like registry keys
based on the condition message box to be displayed.
To achieve above requirement custom action (VC++ dll) is added in MSI Installer, after doing this MSI installer is able to
display message but after pressing OK button from the displayed message and even returning some error from the custom
action function processing of Installer is resumed again.
Based on some conditition and by by using custom action I need to display the a modal message and after pressing the OK
button from the displayed message, processing of MSI Installer should be terminated/stopped.
Please suggest by using custom action how to stop processing of MSI Installer.
Thank You
Answers (6)
By the way, the fact that your users are allowed to run installs and uninstalls means that they have local administrative rights, correct? Dangerous territory...
Note that, if you want to persist in the custom-rolled approach, your MSI needs to cater for silent installations.
Comments:
-
I have to check version of the installed MSI from the registry and incase installed version [retrieved from registry] is old version and currently running installer is latest one then some message [Modal Window] to be displayed to the user and when user click the OK button then processing of installer will be terminated.
Please suggest can this functionality be achieved without implementing custom actions or not.
In case above functionality can be achieved without implementing custom actions then please suggest the way to achieve it. - programmer1983 9 years ago
It seems, though, that you want to allow the user to abort the upgrade. Quite why isn't clear :-(
Comments:
-
Hi VBScab,
Thank you very much for you response.
By using the following snippet I am able to display modal message from MSI installer and stop the processing of the installer.
//code
PMSIHANDLE hRec = MsiCreateRecord(2);
MsiRecordSetString(hRec,0,pszMsg);
UINT uiRet =
MsiProcessMessage(hInstall,INSTALLMESSAGE(INSTALLMESSAGE_USER |dwOptions),hRec);
return ERROR_INSTALL_USEREXIT;
But As per our requirement I have to display the message to the user at the time of uninstall, when after installing the product user again run the installer then installer displays message to the user and based on user action uninstall processing should be cancelled.
but when the user selects uninstall option from Add/remove program then no message should not be displayed and uninstall done successfully.
By using custom actions and above code snippet, When uninstall is performed by using MSI installer then message is displayed to the user and based on user action processing of uninstall processing is terminated.
But while trying to uninstall by using the Add/Remove program same behavior is observed, means message is displayed to the user and based on user action uninstall processing is terminated.
Please suggest how to achieve above functionality, i.e. while trying to uninstall by using MSI installer some message should be displayed to the user and based on user action uninstall processing is terminated and while uninstall from Add/remove program no message should be displayed and product should uninstall successfully.
Means how to differentiate between the processing while uninstalling using MSI installer and while uninstalling using Add/remove program. - programmer1983 9 years ago
Please suggest can this functionality be achieved without implementing custom actions or not.
In case above functionality can be achieved without implementing custom actions then please suggest the way to achieve it. - programmer1983 9 years ago