Click here to Skip to main content
15,889,096 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I originally asked this question here on StackOverflow:

Detecting .NET8 with Inno Setup and InnoDependenciyInstaller

And, it the comments it was suggested that I also reach out here to the author of the NuGet package. So, here goes:

I am looking at using InnoDependencyInstaller and it has a function that it uses under the hood:

Dependency_AddDotNet80

Pascal
procedure Dependency_AddDotNet80;
begin
  // https://dotnet.microsoft.com/download/dotnet/8.0
  if not Dependency_IsNetCoreInstalled('-n Microsoft.NETCore.App -v 8.0.0') then begin
    Dependency_Add('dotnet80' + Dependency_ArchSuffix + '.exe',
      '/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
      '.NET Runtime 8.0.0' + Dependency_ArchTitle,
      Dependency_String('https://download.visualstudio.microsoft.com/download/pr/593685c9-7e98-455a-8e34-4b8ad1be9489/6ccf85c6fc244428d61f74ca3aee0645/dotnet-runtime-8.0.0-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/7f4d5cbc-4449-4ea5-9578-c467821f251f/b9b19f89d0642bf78f4b612c6a741637/dotnet-runtime-8.0.0-win-x64.exe'),
      '', False, False);
  end;
end;


My query is with this test:

Pascal
if not Dependency_IsNetCoreInstalled('-n Microsoft.NETCore.App -v 8.0.0')


I think the latest installer of .NET8 is greater than 8.0.0. So will this test fail? I would ask on the GitHub repository page but there is no way to create an issue there.

Footnote: Here is a related question on this subject, where it refers to 8.0.3:

Check if .NET 5.0 is installed in Inno Setup

So, I essentially have 2 related queries:

1. How can we ensure that we are checking for (and downloading) the latest .NET8 using this system? Ideally the feedback to the users should state it, eg. 8.0.3.

2. How can we install both the x86 (if required) and x64 versions of the .NET8 runtime? Because, when I tried using Dependency_AddDotNet80; on a test laptop it only installed the x86 version.

It is a pity that this excellent GitHub tool doesn't add any logging into the installation log. The only thing I gleaned is that it it downloaded netcorecheck.exe into the temporary folder for using during installation.

What I have tried:

I have followed the sample code on the GitHub repository but unable to test as I already have the latest .NET8 runtime installed.

Did initial test using a spare laptop that we have.
Posted
Updated 6-Apr-24 7:13am
v5
Comments
Dave Kreskowiak 6-Apr-24 13:09pm    
If you're trying to get in touch with the author of a component, you're going to have to contact that author directly. Just posting your message in the public forum is just relying on whoever that person is to stumble across your post, which is extremely unlikely.

If you're talking about an article here on CP, there is a forum at the bottom of the article in which the author is notified of every post.
Andrew Truckle 6-Apr-24 14:18pm    
Ah, got it: https://www.codeproject.com/Articles/20868/Inno-Setup-Dependency-Installer
Andrew Truckle 6-Apr-24 13:28pm    
I just posted a comment on his article, but it is in moderation:

https://www.codeproject.com/Messages/5995746/Detecting-NET8
Pete O'Hanlon 6-Apr-24 14:01pm    
I have unblocked your question on that forum.
Andrew Truckle 6-Apr-24 14:18pm    
Thank you! I just fixed a typo and it has gone into moderation again. 🤭

1 solution

As this appears to use netcorecheck, it means that the version check is an exact version, so passing 8.0.0 inside looks to see if that version is installed, so if you need 8.0.3, this would have to be passed in.
 
Share this answer
 
Comments
Maciej Los 8-Apr-24 16:24pm    
5ed!
Pete O'Hanlon 8-Apr-24 16:59pm    
Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900