dgxhubbard
dgxhubbard

Reputation: 703

How to detect net core 3.1 windows desktop app runtime is installed

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>

Upvotes: 3

Views: 1584

Answers (1)

Bob Arnson
Bob Arnson

Reputation: 21886

You want DirectorySearch, not FileSearch.

Upvotes: 2

Related Questions