Add .NET 8 Runtime Check to Installer Scripts#2762
Conversation
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
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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:
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.
…om/pyrevitlabs/pyRevit into fix/dotnet-depency-check-installer
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.
|
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? |
sanzoghenzo
left a comment
There was a problem hiding this comment.
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=x64in[Setup] - Add the following (not sure if we need both):
[Code] function InitializeSetup: Boolean; begin Dependency_AddDotNet80; Dependency_AddDotNet80Desktop; Result := True; end;
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.
Yes, I noticed the thing, but did not take the time to analyze the complexity of implementation.
both are required (at least in the test I have done)
The testing was a bit more involved, but it works as advertised. Note to self: |
sanzoghenzo
left a comment
There was a problem hiding this comment.
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...)
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. |
indeed |
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.
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25232+1126-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25232+1352-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25233+0639-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25233+1431-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25233+1438-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25269+1431-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25269+1436-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25269+1822-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25271+1719-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25272+2003-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25272+2012-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25272+2017-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25272+2149-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25274+1734-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25277+1425-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25277+1427-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25279+2157-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25280+0218-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25280+1054-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25280+1057-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25282+1656-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25283+0140-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25286+1022-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25287+0905-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25287+1000-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25288+0613-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25293+0755-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25293+0828-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25293+1113-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25293+1234-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25295+0707-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25296+0824-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25296+0837-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25296+0923-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25302+0949-wip |
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
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! 🎉