0

Can anyone tell me why this is not working please? I have two registry checks to check if Visual C++ Redistributables are installed:

<Property Id="REGDBKEYEXISTX64">
  <RegistrySearch Id="REGDBKEYEXISTX64" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\{837b34e3-7c30-493c-8f6a-2b0f04e2912c}" Name="Version" Type="raw" Win64="yes" />
</Property>

<!--Checking if Microsoft Visual C++ Redistributables are installed on a 32-bit system-->
<Property Id="REGDBKEYEXIST">
  <RegistrySearch Id="REGDBKEYEXIST" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\{837b34e3-7c30-493c-8f6a-2b0f04e2912c}" Name="Version" Type="raw" Win64="no" />
</Property>

I then run a custom action if they are not installed:

<Custom Action="InstallRedistributables" After="GetVariantName">Installed OR REGDBKEYEXISTX64 OR REGDBKEYEXIST</Custom>

However when the redistributables are installed it still runs the custom action which is what i do not want. I know it detects it as this is my log file:

Property: REGDBKEYEXIST, Signature: REGDBKEYEXIST

 MSI (c) (4C:44) [12:19:04:989]: PROPERTY CHANGE: Adding REGDBKEYEXIST property. Its value is '#134276921'.

So what could be the problem? I have this done on another custom action and it works perfectly so i really don't know the solution.

Natalie Carr
  • 3,707
  • 3
  • 34
  • 68

1 Answers1

0

It appears your condition is reversed. The REGDBKEYEXIST properties will be set if the registry key exists, and thus true when the search indicates the redistributable is present. So what you probably want is more like NOT REGDBKEYEXIST You also probably only want to run this on first time install (hence your reference to Installed). So I would suggest changing your condition to something more like the following:

NOT(Installed or REGDBKEYEXIST or REGDBKEYEXISTX64)
Michael Urman
  • 15,737
  • 2
  • 28
  • 44
  • Thanks that worked..:) can you explain why it was reversed? Did i do something wrong? Thanks – Natalie Carr Aug 30 '12 at 11:53
  • 2
    Better question is where is this custom action scheduled and why is he using a custom action to install a redist? WiX has Burn to handle prereqs. – Christopher Painter Aug 30 '12 at 12:33
  • @ChristopherPainter I have it working using burn, however not keen on the dialog it displays, would rather it only showed my MSI UI but it still shows the burn one that is why I decided against using burn, although burn was alot handier. :) – Natalie Carr Aug 31 '12 at 14:19