Search code examples
wixwindows-installer

Wix tools Ignore registry fail and continue


I need to insert a registry key in wix but the result is not important how can I Ignore error.

sometimes because of permission reg creation fails

<Component Id="EXTEND_ADVANCE_TEXT_SERVICE" Guid="*">
                      <RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\CTF\SystemShared" Action="createAndRemoveOnUninstall">
                        <RegistryValue Type="integer" Name="CUAS" Value="1" KeyPath="yes"/>                            
                      </RegistryKey>
                      <Condition><![CDATA[VersionNT >= 501 AND VersionNT <= 502]]></Condition>                          
                    </Component>

Solution

  • The RegistryKey element does not have any error handling. Use a custom action and ignore the return code. There are plenty ways to do this, you can either author one in code or use a quiet execution custom action.