Stop displaying custom dialogs when uninstalling WiX

I have a WiX setup project that uses a custom dialog to ask options to update the web.config file and run the script database on install. Everything is working correctly and the application is installed and working correctly.

However, the custom dialog is also displayed when uninstalling the software and this is certainly not necessary (since I am not updating the web.config file).

Is there a way to suppress custom dialog when uninstalling an app?

(I also have to uninstall the sql handlers that I am installing during uninstallation, but that is not the case for this issue).

+2


source to share


2 answers


The solution to your question is a custom action condition with a condition ( Not REMOVE = "ALL" ). This will cause the action to run on a fresh install and maintenance installation, but not on uninstall. If you do not need to run the maintenance installation, but only on a fresh installation, you can set the condition: ( Not installed AND NOT (REMOVE = "ALL" )). The full list of MSI properties and briefs is here: http://msdn.microsoft.com/en-us/library/aa370905(VS.85).aspx .

The logic for sequencing and custom actions in MSI files is VERY complex. It really pays off to avoid user action when you can.



There is more - all MSI files have built-in support for silent installation. This means that the entire GUI sequence can be skipped and the MSI file installed without user interaction. This is a key feature for enterprise deployments via SMS / SCCM or other deployment mechanisms. Displaying a custom dialog when running the installation in silent mode violates this basic MSI functionality. You can work around this by properly configuring the dialog display based on the UILevel property : http://msdn.microsoft.com/en-us/library/aa372096(VS.85).aspx... Just to keep things interesting and confusing, Microsoft defined 4 levels of GUI during installation, ranging from being completely silent, using various options like a progress bar, etc. See link for details.

I could add a lot of detail here about sequences, conditions, MSI custom actions, etc., but it wouldn't answer your question. Please add any follow-up questions.

+2


source


Wix snippet to show creating a custom activity and inserting it into InstallExecuteSequence:



<!--Custom Action Sample Section-->
<Binary Id='VBScriptCustomAction.vbs' SourceFile='VBScriptCustomAction.vbs'/>
<CustomAction Id='test' BinaryKey='VBScriptCustomAction.vbs' VBScriptCall='Hello' Return='ignore'/>

<InstallExecuteSequence>
  <Custom Action="test" Sequence='4111'><![CDATA[NOT REMOVE~="ALL"]]></Custom>
</InstallExecuteSequence>
<!-- End of Custom Action Sample Section-->

      

0


source







All Articles