3

I am trying to detect if the net core 3.1 windows desktop app runtime is installed and not run the installer if it is.

However on a test system that has net core 3.1 windows desktop app runtime installed I can see the installer run and after looking at the log, NetCoreInstalled, evaluates to 0 even though the directory exists. How can I get this working?

<Fragment>

    <util:FileSearch 
      Id="NetCoreInstalled" 
      Variable="NetCoreInstalled"
      Path="[ProgramFiles64Folder]dotnet\shared\Microsoft.WindowsDesktop.App\3.1.0"
      Result="exists" />
    
    <PackageGroup Id="NetCore310x64">


        <ExePackage
     Id="NetCore310x64"
     Cache="no"
     Compressed="yes"
     PerMachine="yes"
     InstallCondition="(VersionNT64) AND (NOT NetCoreInstalled)"
          DetectCondition="NetCoreInstalled"
          InstallCommand="/quiet /passive"
     Vital="yes"
     Permanent="yes"
     SourceFile="..\..\..\Requirements\windowsdesktop-runtime-3.1.0-win-x64.exe"
     Name="Redist\windowsdesktop-runtime-3.1.0-win-x64.exe" />

    </PackageGroup>


  </Fragment>
dgxhubbard
  • 703
  • 2
  • 7
  • 18
  • Where did you find the Conditions such as 'InstallCondition="(VersionNT64) AND (NOT NetCoreInstalled)"'? – Fy Z1K Apr 11 '20 at 15:17

1 Answers1

2

You want DirectorySearch, not FileSearch.

Bob Arnson
  • 21,377
  • 2
  • 40
  • 47