1

With the wix installer I want to check if an registry entry is set. If it is not set I want to abort the installation process without displaying a message dialog.

I use the Condition element to check if the entry is there and abort the installation, but this element requires an Message attribute, which is then displayed in an message box.

I want to ignore this message box and silently abort the installation.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Fragment>
    <Property Id="Property_XXX">
      <RegistrySearch 
         ...
         ...
         ...
      </RegistrySearch>   
    </Property>
    
    <Condition Message="This message should not be displayed">
      <![CDATA[Installed OR Property_XXX]]>
    </Condition>

    <SetProperty Id="Dir.ProgramDir.xxx" Value="[Property_XXX]" After="CostInitialize"/> 
  </Fragment>
</Wix>

Message box should be ignored

Is there a simple way to abort and installation (like with the Condition element), but without displaying a message box?

Berni
  • 41
  • 7

1 Answers1

0

I did this using managed code(c#) custom action in which I called following to abort installation without message box.

throw new Exception("");

This might not be easy if you're not familiar with manage code custom action.

Other simple approach is to give it a try using vbscript as per below post(I didn't try):

How can I abort an InstallShield Setup depending on a vbscript custom action result?

Vivek Jaiswal
  • 861
  • 1
  • 7
  • 20