Add support for Revit 2027 secure location for addin manifest#3034
Add support for Revit 2027 secure location for addin manifest#3034
Conversation
|
Unable to trigger custom agent "Code Reviewer"You have run out of credits 😔 |
- Update GetRevitAddonsFolder() to use new secure path for Revit 2027+ all-users installations - Update GetManifest() to search both old and new locations for migration scenarios - Add unit tests for path logic verification - Maintain backward compatibility for Revit ≤2026 and user-level installations Co-authored-by: jmcouffin <7872003+jmcouffin@users.noreply.github.com>
|
Ref: FS-ImprovedFilePermissionssecurityforAddins.pdf
|
There was a problem hiding this comment.
Pull request overview
Adds support for Revit 2027+ “secure” all-users addin manifest location and enables migration by searching both old and new manifest folders.
Changes:
- Update Revit addins folder resolution for Revit 2027+ all-users installs to use the Revit install directory (with a fallback default).
- Update manifest discovery to search both new (2027+) and legacy locations for migration scenarios.
- Add unit tests and update committed binaries under
bin/to match the build output.
Reviewed changes
Copilot reviewed 2 out of 31 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| dev/pyRevitLabs/pyRevitLabs.TargetApps.Revit/RevitAddons.cs | Implements Revit 2027+ secure all-users addins path logic and dual-location manifest search. |
| dev/pyRevitLabs/pyRevitLabs.UnitTests/pyRevitLabs.UnitTests.RevitAddons.cs | Adds tests for Revit addins folder/path behavior across version boundaries. |
| bin/netfx/pyRevitLabs.TargetApps.Revit.dll | Updated compiled assembly reflecting the source changes. |
| bin/netfx/System.Threading.Tasks.Extensions.dll | Newly added/updated runtime dependency included in bin/netfx. |
| bin/netfx/System.Runtime.CompilerServices.Unsafe.dll | Newly added/updated runtime dependency included in bin/netfx. |
| bin/netfx/DotNetVersionFinder.dll | Newly added/updated dependency included in bin/netfx. |
| bin/netcore/DotNetVersionFinder.dll | Newly added/updated dependency included in bin/netcore. |
dev/pyRevitLabs/pyRevitLabs.UnitTests/pyRevitLabs.UnitTests.RevitAddons.cs
Outdated
Show resolved
Hide resolved
dev/pyRevitLabs/pyRevitLabs.UnitTests/pyRevitLabs.UnitTests.RevitAddons.cs
Outdated
Show resolved
Hide resolved
dev/pyRevitLabs/pyRevitLabs.UnitTests/pyRevitLabs.UnitTests.RevitAddons.cs
Outdated
Show resolved
Hide resolved
dev/pyRevitLabs/pyRevitLabs.UnitTests/pyRevitLabs.UnitTests.RevitAddons.cs
Show resolved
Hide resolved
|
@copilot Review the comments in the pr and make necessary changes |
- Update debug message to reflect both cases when install location is not available - Use LINQ .Where() for filtering files with case-insensitive comparison - Fix unit tests to use case-insensitive path comparisons - Update tests to check path structure instead of hardcoded Program Files location - Remove redundant test case and clarify test intent Co-authored-by: jmcouffin <7872003+jmcouffin@users.noreply.github.com>
dev/pyRevitLabs/pyRevitLabs.UnitTests/pyRevitLabs.UnitTests.RevitAddons.cs
Show resolved
Hide resolved
dev/pyRevitLabs/pyRevitLabs.UnitTests/pyRevitLabs.UnitTests.RevitAddons.cs
Show resolved
Hide resolved
dev/pyRevitLabs/pyRevitLabs.UnitTests/pyRevitLabs.UnitTests.RevitAddons.cs
Show resolved
Hide resolved
dev/pyRevitLabs/pyRevitLabs.UnitTests/pyRevitLabs.UnitTests.RevitAddons.cs
Show resolved
Hide resolved
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26030+2136-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26030+2147-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26030+2212-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1043-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1111-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1304-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1323-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1433-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1538-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1543-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1553-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1612-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1624-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1738-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1743-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1829-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1937-wip |
|
📦 New work-in-progress (wip) builds are available for 6.0.0.26032+1956-wip |
|
📦 New work-in-progress (wip) builds are available for 6.0.0.26032+2005-wip |
|
📦 New work-in-progress (wip) builds are available for 6.0.0.26032+2008-wip |
|
📦 New public release are available for 6.0.0.26032+2040 |
|
📦 New public release are available for 6.0.0.26032+2040 |
Implementation Plan for Revit 2027 Secure Addin Location Support
RevitAddons.csGetRevitAddonsFolder()methodGetManifest()methodRevitProduct.InstallLocationpropertyGetRevitAddonsFolder()methodallUsers == trueANDrevitYear >= 2027RevitProduct.InstallLocationGetManifest()method for migration scenariosCode Review Changes Addressed
.Where()withStringComparison.OrdinalIgnoreCasefor cleaner, case-insensitive filteringStartsWith()calls to useStringComparison.OrdinalIgnoreCaseAddins\<year>)GetRevitAddonsFilePath_Consistency_TestAll changes maintain backward compatibility while addressing the code review feedback.
Original prompt
Add support for Revit 2027 secure addin manifest location
Background
Starting with Revit 2027, Autodesk is implementing improved file permissions security for addins. The current all-users addin location (
%ProgramData%\Autodesk\Revit\Addins\<year>\) will be deprecated and unsupported starting from Revit 2027.New Addin Paths (Revit 2027+)
%AppData%\Autodesk\Revit\Addins\<year>\%ProgramData%\Autodesk\Revit\Addins\<year>\C:\Program Files\Autodesk\Revit <year>\Addins\<year>\Reference: Autodesk Revit 2027 security improvements documentation.
Required Changes
The pyRevit attachment system needs to be updated to handle the new secure location for Revit 2027 and later versions.
Files to Modify
dev/pyRevitLabs/pyRevitLabs.TargetApps.Revit/RevitAddons.csGetRevitAddonsFolder()method to return the appropriate path based on Revit versionC:\Program Files\Autodesk\Revit <year>\Addins\<year>\%ProgramData%\Autodesk\Revit\Addins\<year>\Implementation Details
The
GetRevitAddonsFolder()method should:revitYearparameter (already exists)allUsers == trueANDrevitYear >= 2027RevitProduct.InstallLocationpropertyExample logic:
Testing Considerations
CommonUtils.EnsureFile()already handles directory creation)C:\Program Files\(already required for all-users installations)Additional Considerations
The
GetManifest()method should also be updated to search both locations for Revit 2027+ when looking for existing manifests, to handle migration scenarios where old manifests might still exist.Impact Analysis
Documentation Updates
Update documentation to:
Acceptance Criteria
GetRevitAddonsFolder()returns correct path for all-users installations on Revit 2027+This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.