From 6ccbc909f7cc48b2383778b3a2404ce626ec5037 Mon Sep 17 00:00:00 2001 From: Mauro Cunha Date: Wed, 19 Nov 2025 11:50:46 +0000 Subject: [PATCH 1/6] Normalize MSBuild condition checks with quoted properties Update all Condition expressions to use '$(Property)' string comparisons for true/false and empty checks, instead of relying on unquoted property expansions. --- .../targets/Nice3point.Revit.Publish.targets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets b/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets index 9616bc2..7bca8a1 100644 --- a/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets +++ b/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets @@ -16,7 +16,7 @@ + Condition="'$(PublishRevitAddin)' == 'true' AND '$(RevitVersion)' != ''"> @@ -46,7 +46,7 @@ + Condition="'$(DeployRevitAddin)' == 'true'"> @@ -60,7 +60,7 @@ + Condition="'$(DeployRevitAddin)' == 'true'"> @@ -68,7 +68,7 @@ + Condition="'$(PublishRevitAddin)' == 'true'"> From 4e77518cc8ddd27c72ea731307ff85fd83b55ae4 Mon Sep 17 00:00:00 2001 From: Mauro Cunha Date: Wed, 19 Nov 2025 15:32:42 +0000 Subject: [PATCH 2/6] Update deployment paths for Revit add-ins Added `AppDataDeployDir` to specify the deployment directory for Revit add-ins. Updated the copying and cleaning processes to use the new path instead of the previous hardcoded location, ensuring proper management of add-in files during the build process. --- .../targets/Nice3point.Revit.Publish.targets | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets b/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets index 7bca8a1..782de9b 100644 --- a/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets +++ b/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets @@ -12,7 +12,9 @@ false true false - + + $(AppData)\Autodesk\Revit\Addins\$(RevitVersion) + + DestinationFolder="$(AppDataDeployDir)\%(RecursiveDir)"/> - + - - + + Date: Wed, 19 Nov 2025 16:06:09 +0000 Subject: [PATCH 3/6] Add optional versioned deployed add-in folder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce the AppendVersion property (with an optional VersionDelimiter) to deploy the add-in into a versioned folder instead of using the bare assembly name. When this is enabled, the manifest’s Assembly path and the clean step are updated to target the versioned folder. --- .../targets/Nice3point.Revit.Publish.targets | 38 +++++++++++++++---- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets b/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets index 782de9b..a575e1c 100644 --- a/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets +++ b/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets @@ -9,11 +9,16 @@ --> - false + $(AppData)\Autodesk\Revit\Addins\$(RevitVersion) + + false true false - $(AppData)\Autodesk\Revit\Addins\$(RevitVersion) + false + $(AssemblyName)$(VersionDelimiter)$(AssemblyVersion) + $(AssemblyName) + $(AppDataDeployDir)\$(AddinFolder) - - - + + + + - + + + + + + + + + + - + From 30bdf3817a17f2cd4689bb4d7bb0bb2c7e248d9a Mon Sep 17 00:00:00 2001 From: Mauro Cunha Date: Wed, 19 Nov 2025 16:23:11 +0000 Subject: [PATCH 4/6] Add versioned folder deployment instructions to README Update Readme.md to include a new section on enabling versioned folder deployment for Revit add-ins. Document the default local deployment behavior, how to use the AppendVersion property as well as the optional VersionDelimiter, and provide an example XML configuration. --- Readme.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Readme.md b/Readme.md index c7689a1..995e89d 100644 --- a/Readme.md +++ b/Readme.md @@ -104,6 +104,29 @@ Should only be enabled in projects containing the Revit manifest file (`.addin`) `Clean solution` or `Clean project` commands will delete the deployed files. +#### Versioned folder for local deployment + +By default, local deployment copies the add-in into a folder named after the assembly under +`%AppData%\Autodesk\Revit\Addins\$(RevitVersion)` (for example, `RevitAddIn`). + +If you want the deployment folder name to include the assembly version (for example, `RevitAddIn_1.2.3`), +enable the `AppendVersion` property. Optionally, you can also define a separator between the name and version +with `VersionDelimiter`: + +```xml + + true + true + _ + +``` + +When `AppendVersion` is enabled and `AssemblyVersion` is defined, the add-in will be deployed into a +versioned folder, and the `.addin` manifest will be updated automatically to point to the versioned path. +If `AppendVersion` is not set (or `AssemblyVersion` is missing), the non-versioned folder name is used as before. + +_Default: Disabled_ + #### Publishing for distribution If your goal is to generate an installer or a bundle, enable the `PublishRevitAddin` property. From 61b30dfdb49f132436f33be6b785354a03e4b019 Mon Sep 17 00:00:00 2001 From: Mauro Cunha Date: Thu, 20 Nov 2025 12:21:10 +0000 Subject: [PATCH 5/6] Support ProgramData deployment and unify add-in manifest naming. Added an optional DeployToProgramData flag to allow deploying the Revit add-in under %ProgramData% instead of %AppData%, centralized the DeployDir logic so all deploy/update/clean targets use the same base path, and introduced the AddinManifestFileName ($(AssemblyName).addin) property to reference the manifest consistently across all targets and the PowerShell update step. --- .../targets/Nice3point.Revit.Publish.targets | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets b/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets index a575e1c..fcf0bd5 100644 --- a/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets +++ b/source/Nice3point.Revit.Build.Tasks/targets/Nice3point.Revit.Publish.targets @@ -10,15 +10,20 @@ $(AppData)\Autodesk\Revit\Addins\$(RevitVersion) - + $(ProgramData)\Autodesk\Revit\Addins\$(RevitVersion) + false + $(ProgramDataDeployDir) + $(AppDataDeployDir) + false true false - - false - $(AssemblyName)$(VersionDelimiter)$(AssemblyVersion) - $(AssemblyName) - $(AppDataDeployDir)\$(AddinFolder) + + false + $(AssemblyName)$(VersionDelimiter)$(AssemblyVersion) + $(AssemblyName) + $(DeployDir)\$(AddinDeployFolder) + $(AssemblyName).addin - + <_ResolvedFileToPublishAlways Include="@(Content)" PublishDirectory="%(Content.PublishDirectory)" Condition="'%(Content.CopyToPublishDirectory)' == 'Always'"/> <_ResolvedFileToPublishPreserveNewest Include="@(Content)" PublishDirectory="%(Content.PublishDirectory)" Condition="'%(Content.CopyToPublishDirectory)' == 'PreserveNewest'"/> - + $(PublishDir)\Revit $(RevitVersion) $(Configuration) addin\ $(RootDir)$(AssemblyName)\ @@ -56,17 +61,17 @@ Condition="'$(DeployRevitAddin)' == 'true'"> - + + DestinationFolder="$(DeployDir)" /> - + - + - - + Date: Thu, 20 Nov 2025 12:22:31 +0000 Subject: [PATCH 6/6] Document ProgramData/AppData deployment option in README --- Readme.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 995e89d..6cdcdc1 100644 --- a/Readme.md +++ b/Readme.md @@ -88,7 +88,7 @@ Depending on your workflow, you can either deploy the files locally for immediat #### Local deployment -To copy Revit add-in files to the `%AppData%\Autodesk\Revit\Addins` folder after building a project, you can enable the `DeployRevitAddin` property. +To copy Revit add-in files to the default `%AppData%\Autodesk\Revit\Addins` folder after building a project, you can enable the `DeployRevitAddin` property. Copying files helps attach the debugger to the add-in when Revit starts. This makes it easier to test the application or can be used for local development. @@ -104,6 +104,24 @@ Should only be enabled in projects containing the Revit manifest file (`.addin`) `Clean solution` or `Clean project` commands will delete the deployed files. +#### Local deployment location (ProgramData vs AppData) + +By default, local deployment copies the add-in files to `%AppData%\Autodesk\Revit\Addins\$(RevitVersion)`. + +If you prefer to deploy to `%ProgramData%\Autodesk\Revit\Addins\$(RevitVersion)`, enable the +`DeployToProgramData` property alongside `DeployRevitAddin`: + +```xml + + true + true + +``` + +When `DeployToProgramData` is `false` or not set, the add-in continues to be deployed under `%AppData%`. + +_Default: Disabled_ + #### Versioned folder for local deployment By default, local deployment copies the add-in into a folder named after the assembly under