What's the correct way to determine .net core version in prerequisites - Advanced Installer Community
rosergeev
Posts: 3
Joined: Tue Mar 07, 2023 3:26 pm

What's the correct way to determine .net core version in prerequisites

I have installer where in prerequisites I have .net core 6.0.9 package. In install condition section I'm verifying existence of registry key HKLM\SOFTWARE\Microsoft\ASP.NET Core\Shared Framework\v6.0\6.0.9. But the installation failed when machine already has installed newer version of .net core, e.g. 6.0.11. With my condition installer sees that there is no such key in registry and tries to install .net core 6.0.9 and fails as newer version is already installed. What is the correct way to set install conditions for that case - starting from version 6.0.9 and all versions above (6.0.10, 6.0.11, 6.0.12, 6.0.13)? And of course it shouldn't work with next core version like .net core 7
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: What's the correct way to determine .net core version in prerequisites

Hello and welcome to our forums,

I have tested this and wasn't quite able to replicate the behavior your mentioned.

If possible, could you please give me some more details about how the setup is failing? Does it fail to install?

Here's how I tested this:

- installed ASP .NET Framework 6.0.14 manually on my machine

- added v6.0.9 as a prerequisite

Installed the setup and the prerequisite and both were installed.
Screenshot_95.png
Screenshot_95.png (10.15 KiB) Viewed 12687 times


Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: What's the correct way to determine .net core version in prerequisites

Hello,

Please disregard my above reply!

As a followup to this, here would be the correct condition to use:
Screenshot_96.png
Screenshot_96.png (13.3 KiB) Viewed 12684 times
This way, if a higher version of the prerequisite is installed, it shouldn't install yours.

I have tested this by manually installing 6.0.14 and then adding 6.0.9 as a prerequisite and it does not install 6.0.9.

Hope it helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rosergeev
Posts: 3
Joined: Tue Mar 07, 2023 3:26 pm

Re: What's the correct way to determine .net core version in prerequisites

Thank you for your reply. Your approach with folders and min version works fine.
But let me share what's happening before that change. When I start the installation,by the way we upgraded the framework version to 7.0.2, on the machine that has newer version of .net core (7.0.3):
InstalledFramework.png
InstalledFramework.png (153.46 KiB) Viewed 12094 times
then installation failed with an error:
InstallationFailed.png
InstallationFailed.png (110.17 KiB) Viewed 12094 times
And I found the following in log file:
InstallationLog.png
InstallationLog.png (107.38 KiB) Viewed 12094 times
And explanation from Microsoft of the exit code https://learn.microsoft.com/en-us/windo ... 1300-1699- says that another version of the product is already installed:
rosergeev
Posts: 3
Joined: Tue Mar 07, 2023 3:26 pm

Re: What's the correct way to determine .net core version in prerequisites

ErrorCode.png
ErrorCode.png (59.18 KiB) Viewed 12094 times
Liviu
Posts: 1419
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: What's the correct way to determine .net core version in prerequisites

Hello,

Thank you for your follow up on this. Glad to hear everything is now working as expected.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”