1

I'm currently using Wix 3.10 on windows 10.

I'm trying to find if the VC++ 2005 runtime x64 (v8.0.61000) is installed by product code. It's definitely showing in add-remove programs. The ProductCode definitely exists in the uninstall registry section and in Win32_Product. Get-Package in powershell shows it as well:

Get-Package | Where Name -Like "*2005*" | select -First 1 | fl

PropertyOfSoftwareIdentity : PropertyOfSoftwareIdentity
FastPackageReference       : {ad8a2fa1-06e7-4b0d-927d-6e54b3d31028}
ProviderName               : msi
Source                     :
Status                     : Installed
SearchKey                  :
FullPath                   :
PackageFilename            : ?
FromTrustedSource          : False
Summary                    :
SwidTags                   : {Microsoft Visual C++ 2005 Redistributable (x64)}
CanonicalId                : msi:Microsoft Visual C++ 2005 Redistributable (x64)/8.0.61000
Metadata                   : {ProductCode}
SwidTagText                : <?xml version="1.0" encoding="utf-16" standalone="yes"?>
                             <SoftwareIdentity
                               name="Microsoft Visual C++ 2005 Redistributable (x64)"
                               version="8.0.61000"
                               versionScheme="multipartnumeric"
                               tagId="ad8a2fa1-06e7-4b0d-927d-6e54b3d31028"
                             xmlns="http://standards.iso.org/iso/19770/-2/2015/schema.xsd">
                               <Meta
                                 ProductCode="{ad8a2fa1-06e7-4b0d-927d-6e54b3d31028}" />
                             </SoftwareIdentity>
Dependencies               : {}
IsCorpus                   :
Name                       : Microsoft Visual C++ 2005 Redistributable (x64)
Version                    : 8.0.61000
VersionScheme              : multipartnumeric
TagVersion                 :
TagId                      : ad8a2fa1-06e7-4b0d-927d-6e54b3d31028
IsPatch                    :
IsSupplemental             :
AppliesToMedia             :
Meta                       : {{ProductCode}}
Links                      : {}
Entities                   : {}
Payload                    :
Evidence                   :
Culture                    :
Attributes                 : {name,version,versionScheme,tagId}

But when I create a launch condition, and use util:ProductSearch it returns blank, causing the condition to trigger and exit.

  <Fragment>
    <Property Id="LC_MSVCPP_8_0_X64_LATEST_REQUIRED" Value="LaunchCondition" />

    <util:ProductSearch Id="MSVC2005.v8.0.61000.x64" Variable="MSVCPP_8_0_61000_X64_DETECTED" ProductCode="{AD8A2FA1-06E7-4B0D-927D-6E54B3D31028}" Result="version" />

    <Condition Message="VC++ 2005 x64 runtime not found!">MSVCPP_8_0_61000_X64_DETECTED</Condition>
  </Fragment>

I've also tried a reboot.

I should note that is definitely searchable by upgradeCode. But then I have to do version comparison, and the real problem here is if there is a bug or not?

Any ideas?

Thanks so much!

tcables
  • 1,097
  • 4
  • 15
  • 36
  • 1
    The more I looked at Visual C++ runtime detecting, the more I concluded what I tried was too unreliable. In the end I went for [a home-grown file version check approach](https://stackoverflow.com/a/53639128/129130). – Stein Åsmul Mar 07 '20 at 02:09
  • 1
    Here is something else: [Check for product code installed](https://stackoverflow.com/a/59674645/129130). Remember that product codes can change for upgrades of the runtime. This is probably true both in theory and in practice, though I have not checked whether this is the case for different releases. – Stein Åsmul Mar 07 '20 at 02:14
  • I should add that scripts are sometimes blocked by anti-virus, and hence are not really recommended for use in setups for anything but testing and debugging - and perhaps the getting and setting of properties - as long as you don't invoke any COM objects (if that avoids managed code custom actions with dependency on the .NET runtime - a hefty prerequisite to include if you just get and set properties). – Stein Åsmul Mar 07 '20 at 11:06

1 Answers1

2

util:ProductSearch works in bundles, not MSI packages, so it can't be used in a launch condition.

Bob Arnson
  • 19,440
  • 2
  • 37
  • 45
  • straight from the gods, thanks! Also, maybe as a feature suggestion, to throw a warning or error during compile if this element cant be used? – tcables Mar 09 '20 at 21:21
  • 1
    Yeah, it's been requested but it's non-trivial because bundles also support fragments. Also, we'd love to support the bundle searches as MSI custom actions. Not enough hours in the day, however... – Bob Arnson Mar 09 '20 at 23:39