Skip to content

Fix all-users addin manifest path for Revit 2027+#3277

Open
tay0thman wants to merge 3 commits intopyrevitlabs:developfrom
tay0thman:fix/revit-2027-addin-path
Open

Fix all-users addin manifest path for Revit 2027+#3277
tay0thman wants to merge 3 commits intopyrevitlabs:developfrom
tay0thman:fix/revit-2027-addin-path

Conversation

@tay0thman
Copy link
Copy Markdown
Contributor

@tay0thman tay0thman commented Apr 8, 2026

Fix all-users addin manifest path for Revit 2027+

Problem

Revit 2027 changed how all-users add-in manifests are discovered. The previous three paths behave as follows:

fixes #3275

Path Revit 2027 Behavior
%ProgramData%\Autodesk\Revit\Addins\2027 Ignored — journal says "won't be loaded"
C:\Program Files\Autodesk\Revit 2027\AddIns\ Rejected — reserved for signed internal add-ins only
C:\Program Files\Autodesk\Revit\Addins\2027 Works — new shared third-party location

The current GetRevitAddonsFolder() builds the second path (install-dir based) for 2027+ --allusers attachments, which Revit rejects with "not signed as internal addin".

Revit 2027 journal explicitly states:

Add-in manifest file from: C:\ProgramData\Autodesk\Revit\Addins\2027\pyRevit.addin, won't be loaded. All-users Add-in manifest files must be installed to: C:\Program Files\Autodesk\Revit\Addins\2027

Fix

Simplified GetRevitAddonsFolder() in RevitAddons.cs to use the correct shared path for Revit 2027+:

C:\Program Files\Autodesk\Revit\Addins\<year>

Removed the RevitProduct.ListInstalledProducts() registry lookup which was building the wrong base path.

Changed files

  • dev/pyRevitLabs/pyRevitLabs.TargetApps.Revit/RevitAddons.cs — core path fix
  • Updated binary files (bin/, bin/netcore/, bin/netfx/)

Testing

  • pyrevit attach <clone> default --installed --allusers places manifest at C:\Program Files\Autodesk\Revit\Addins\2027\
  • Revit 2027 loads pyRevit tab successfully from the new path (no signing errors)
  • Revit 2026 and earlier still use %ProgramData% path (unchanged)
  • Per-user path (%APPDATA%) unchanged for all versions
  • pyrevit env shows correct attachment info for all Revit versions (2023–2027)

@tay0thman
Copy link
Copy Markdown
Contributor Author

@jmcouffin I had to recreate this PR because my earlier commits, combined with Copilot edits, were a total mess. Copilot review is welcome.

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

This PR updates pyRevit’s all-users add-in manifest folder resolution to match Revit 2027+’s new discovery rules, ensuring pyrevit attach --allusers writes manifests to the location Revit will actually load.

Changes:

  • Updated RevitAddons.GetRevitAddonsFolder() to use %ProgramFiles%\Autodesk\Revit\Addins\<year> for all-users manifests on Revit 2027+ (and keep %ProgramData% for ≤2026).
  • Updated unit tests to validate the new post-2027 all-users path behavior and the 2026/2027 boundary.
  • Refreshed distributed binaries under bin/ for net48/net8 outputs.

Reviewed changes

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

Show a summary per file
File Description
dev/pyRevitLabs/pyRevitLabs.TargetApps.Revit/RevitAddons.cs Switches 2027+ all-users add-in manifest base folder to the new shared Program Files location; preserves legacy behavior for ≤2026 and per-user installs.
dev/pyRevitLabs/pyRevitLabs.UnitTests/pyRevitLabs.UnitTests.RevitAddons.cs Updates tests to assert the new Program Files-based structure for 2027+ and verify the 2026/2027 boundary.
bin/pyRevitLabs.TargetApps.Revit.dll Updated compiled binary reflecting the path changes.
bin/netfx/pyRevitLabs.TargetApps.Revit.dll Updated net48 binary reflecting the path changes.
bin/netcore/pyRevitLabs.TargetApps.Revit.dll Updated net8.0-windows binary reflecting the path changes.

@pyrevitlabs pyrevitlabs deleted a comment from devloai bot Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Revit 2027 Addins Path

3 participants