Skip to content

Add .NET 8 Runtime Check to Installer Scripts#2762

Merged
jmcouffin merged 8 commits intodevelopfrom
fix/dotnet-depency-check-installer
Aug 20, 2025
Merged

Add .NET 8 Runtime Check to Installer Scripts#2762
jmcouffin merged 8 commits intodevelopfrom
fix/dotnet-depency-check-installer

Conversation

@jmcouffin
Copy link
Copy Markdown
Contributor

Description

Implemented a check for the .NET 8 Runtime in the installation scripts for pyRevit, pyRevit CLI, and pyRevit Admin. If the required runtime is not found, users are prompted to download it from the official Microsoft site. This ensures that the application has the necessary dependencies before proceeding with the installation.
Fixes [Bug]: Installer does not check for .NET "core" runtime #2730


  • Changes are tested and verified to work as expected.

Related Issues

If applicable, link the issues resolved by this pull request:


Additional Notes

I could also have used the https://github.com/DomGries/InnoDependencyInstaller
but I did not want to had more dependencies to the tech stack


Thank you for contributing to pyRevit! 🎉

Implemented a check for the .NET 8 Runtime in the installation scripts for pyRevit, pyRevit CLI, and pyRevit Admin. If the required runtime is not found, users are prompted to download it from the official Microsoft site. This ensures that the application has the necessary dependencies before proceeding with the installation.
Fixes [Bug]: Installer does not check for .NET "core" runtime #2730
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds .NET 8 Runtime detection to all pyRevit installer scripts to ensure required dependencies are available before installation. The implementation checks for the Windows Desktop App runtime in both x64 and x86 program files locations and prompts users to download it from Microsoft if not found.

  • Added runtime detection logic that checks for .NET 8 or higher versions in standard installation paths
  • Implemented user prompting with option to open Microsoft download page when runtime is missing
  • Integrated the check into the installer initialization process across all four installer variants

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
release/pyrevit.iss Added .NET 8 runtime check to main pyRevit installer
release/pyrevit-cli.iss Added .NET 8 runtime check to CLI installer
release/pyrevit-cli-admin.iss Added .NET 8 runtime check to CLI admin installer
release/pyrevit-admin.iss Added .NET 8 runtime check to admin installer

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@devloai devloai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary:

  • Adds .NET 8 Desktop Runtime dependency checks to all four pyRevit installer scripts (.iss files)
  • Checks both x64 and x86 program files directories for Microsoft.WindowsDesktop.App runtime
  • Prompts users to download .NET 8 runtime from Microsoft if not found, then aborts installation
  • Addresses issue #2730 where users couldn't run pyRevit commands due to missing .NET runtime

Review Summary:

This is a solid fix for a critical installation issue. The implementation correctly targets the Microsoft.WindowsDesktop.App runtime which matches the pyrevit.runtimeconfig.json requirements for .NET 8.0. The approach of checking both x64 and x86 paths is appropriate for Windows environments. Found one logic bug in the version parsing that should be addressed to handle edge cases with preview/RC versions.

Follow-up suggestions:

  • @devloai fix the identified version parsing issue to handle non-numeric version suffixes
  • @devloai consider testing the installer with various .NET version scenarios (preview, RC, multiple versions)

jmcouffin and others added 4 commits August 19, 2025 21:52
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Enhanced the installer scripts for pyRevit, pyRevit CLI, and pyRevit Admin by introducing a function to extract the major version from the .NET runtime directory names. This allows for a more robust check against the required .NET 8 Runtime version. If the required version is not found, users are prompted to download it from Microsoft, ensuring necessary dependencies are met before installation proceeds.
Updated the version parsing logic in pyRevit, pyRevit CLI, and pyRevit Admin installer scripts to include comprehensive validation for the major version string. Added checks for valid digit format, reasonable version range (1-99), and improved error logging for better debugging. This ensures that invalid version formats are properly handled, enhancing the robustness of the installation process.
@sanzoghenzo
Copy link
Copy Markdown
Contributor

I ask you the favour of adding me as reviewer only after you run over the AI reviews, so that I don't need to re-check the code each time you push something 😉

Can I start the review now?

Copy link
Copy Markdown
Contributor

@sanzoghenzo sanzoghenzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you see this project? It not only checks for the dependencies, but it also installs it automatically!

It also uses the registry and dotnet --list-runtimes as a more robust way to check for the installed runtimes (user/installers may change the installation path).

You can copy the CodeDependencies.iss file over (and maybe remove the checks we don't need), and follow ExampleSetup.iss to adapt our scripts, Namely:

  • add #include "CodeDependencies.iss" at the beginning of the file
  • add ArchitecturesInstallIn64BitMode=x64 in [Setup]
  • Add the following (not sure if we need both):
    [Code]
    function InitializeSetup: Boolean;
    begin
      Dependency_AddDotNet80;
      Dependency_AddDotNet80Desktop;
      Result := True;
    end;
    

@jmcouffin
Copy link
Copy Markdown
Contributor Author

I ask you the favour of adding me as reviewer only after you run over the AI reviews, so that I don't need to re-check the code each time you push something 😉

Can I start the review now?

Yes, my bad

Updated the pyRevit, pyRevit CLI, and pyRevit Admin installer scripts to include the "CodeDependencies.iss" file. This change ensures that the necessary dependencies for .NET 8 are properly managed during the installation process, enhancing the overall robustness and reliability of the installation. Additionally, the architectures installation mode has been reinstated to x64 for consistency across scripts.
@jmcouffin
Copy link
Copy Markdown
Contributor Author

Did you see this project? It not only checks for the dependencies, but it also installs it automatically!

Yes, I noticed the thing, but did not take the time to analyze the complexity of implementation.
Now I have, and yes, that simple.

It also uses the registry and dotnet --list-runtimes as a more robust way to check for the installed runtimes (user/installers may change the installation path).

You can copy the CodeDependencies.iss file over (and maybe remove the checks we don't need), and follow ExampleSetup.iss to adapt our scripts, Namely:

  • add #include "CodeDependencies.iss" at the beginning of the file
  • add ArchitecturesInstallIn64BitMode=x64 in [Setup]
  • Add the following (not sure if we need both):

both are required (at least in the test I have done)

[Code]
function InitializeSetup: Boolean;
begin
  Dependency_AddDotNet80;
  Dependency_AddDotNet80Desktop;
  Result := True;
end;

The testing was a bit more involved, but it works as advertised.

Note to self:
The installer _signed installer for the CLI installs the CLI in an admin location like the admin_signed one.
I guess this has to do with the fact that the CLI requires to edit some addins manifest in admin Revit location.

@jmcouffin jmcouffin requested a review from sanzoghenzo August 20, 2025 10:44
Copy link
Copy Markdown
Contributor

@sanzoghenzo sanzoghenzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
Just one thing: please remove the commented lines of code (//Dependency_AddDotNet...)

(In the future, we could add a script to download the updated version of the CodeDependencies.iss file...)

@sanzoghenzo
Copy link
Copy Markdown
Contributor

The installer _signed installer for the CLI installs the CLI in an admin location like the admin_signed one.
I guess this has to do with the fact that the CLI requires to edit some addins manifest in admin Revit location.

I believe that's because the intended usage of the CLI is for administrative tasks, so Ehsan didn’t create an installer for regular users.

@jmcouffin
Copy link
Copy Markdown
Contributor Author

jmcouffin commented Aug 20, 2025

(In the future, we could add a script to download the updated version of the CodeDependencies.iss file...)

indeed

@jmcouffin
Copy link
Copy Markdown
Contributor Author

I believe that's because the intended usage of the CLI is for administrative tasks, so Ehsan didn’t create an installer for regular users.

We should remove the pyrevit-cli.iss then, it would help clarify.

Updated the pyRevit, pyRevit CLI, and pyRevit Admin installer scripts by removing commented-out lines for .NET 8 and 9 dependencies. This cleanup enhances the clarity and maintainability of the scripts, ensuring only relevant dependencies are included.
@jmcouffin jmcouffin merged commit 029088e into develop Aug 20, 2025
@jmcouffin jmcouffin added Installer Issues related to the pyRevit installer [subsystem] dependencies Pull requests that update a dependency file labels Aug 20, 2025
@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25232+1126-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25232+1352-wip

@sanzoghenzo sanzoghenzo deleted the fix/dotnet-depency-check-installer branch August 20, 2025 14:20
@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25233+0639-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25233+1431-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25233+1438-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25269+1431-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25269+1436-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25269+1822-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25271+1719-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25272+2003-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25272+2012-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25272+2017-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25272+2149-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 1, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25274+1734-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 4, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25277+1425-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 4, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25277+1427-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 6, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25279+2157-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 7, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25280+0218-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 7, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25280+1054-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 7, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25280+1057-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 9, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25282+1656-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25283+0140-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25286+1022-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25287+0905-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25287+1000-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25288+0613-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25293+0755-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25293+0828-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25293+1113-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25293+1234-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25295+0707-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25296+0824-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25296+0837-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25296+0923-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25302+0949-wip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file Installer Issues related to the pyRevit installer [subsystem]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Installer does not check for .NET "core" runtime

3 participants