Need a way to check .net core version installed and offer to install it if it isn't

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hi all,

    Is there a way to check what version of .net core is installed? And if it isn't, a way to offer to install it?

    How would you do this if there is a way?

    Thank you in advance for any aid :)

    It is for this software: Please login to see this link.. See Troubleshooting steps for specific versions of .net.

    Pete :)
    Please login to see this link.

  • Run the command "C:\Program Files\dotnet\dotnet.exe" --list-runtimes and capture the output, maybe in Console object or Pipe object, or by writing a simple batch file that outputs to text document and running it. See Please login to see this link. for more specifics.

    Darkwire Software Lead Programmer (C++ & C#)
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

  • Run the command "C:\Program Files\dotnet\dotnet.exe" --list-runtimes and capture the output, maybe in Console object or Pipe object, or by writing a simple batch file that outputs to text document and running it. See Please login to see this link. for more specifics.


    I much appreciate the reply, so huge thank you!

    Sadly, I'm no good at writing batch files so put up a help request on stackoverflow which got deleted - so much for asking for help.

    I found batch file code on stackoverflow that someone had put up which runs at the end of the installation but it only works on 64 bit due to the reg key it looks up. So for 32 bit systems, it will always assume they don't have it installed:

    But it works.

    It would be better to have a script which:


    1. runs the command "dotnet --list-runtimes"
    2. checks through the results to see if "Microsoft.NETCore.App 3.1" is installed - maybe store them in a temp output.text file (%TEMP%\dotnetcorecheck.log and use FIND?)
    3. If it isn't present on a users system, then go to download url (Please login to see this link.)
    4. Otherwise informs user they already have it installed.

    Pete :)
    Please login to see this link.

  • To write from batch to a file, use
    echo Installed > output.txt
    The > output means the standard output lines (as opposed to standard error, 2>) will go to the text file.
    The dotnet list--runtimes could work if you output it with >, then use FIND/FINDSTR.

    Alternatively, as seen in the REG line, you can pass the results directly to FIND/FINDSTR with the | operator.
    Program1 | Program2
    ...means Program2 will get Program1's output as Program2's input.

    Darkwire Software Lead Programmer (C++ & C#)
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

  • To write from batch to a file, use
    echo Installed > output.txt
    The > output means the standard output lines (as opposed to standard error, 2>) will go to the text file.
    The dotnet list--runtimes could work if you output it with >, then use FIND/FINDSTR.

    Alternatively, as seen in the REG line, you can pass the results directly to FIND/FINDSTR with the | operator.
    Program1 | Program2
    ...means Program2 will get Program1's output as Program2's input.


    Thank you Phi.

    I have managed to accomplish the checking on net core using the dotnet --list-runtimes command instead of registry key :)

    If anyone else wants the code, here it is:

    Pete :)
    Please login to see this link.

  • So it seems the code above doesn't work correctly if the user doesn't have .net installed. However the following edits allow it to work fully:

    Pete :)
    Please login to see this link.

  • The above script has evolved to this:

    If wanting to use this yourself, feel free to amend where necessary.

    Pete :)
    Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!