Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

User-dependent path for .addin files

ziyad_nuwayhid
Participant

User-dependent path for .addin files

ziyad_nuwayhid
Participant
Participant

Hello everyone,

 

Is it possible to have a user-dependent for the <Assembly> property in the .addin files?
We want to be able to place the .dll files in a sharepoint folder and have the addin file point towards there.

But the path where our sharepoint folder is synced is in the user folder.

The path would look like this :

<Assembly>C:\Users\user.name\Company_SharePoint\InventorExporter.dll</Assembly>

From my understanding every user would have to to replace user.name with their user.

Is there a way to use something like C#'s 

Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)

to get the user folder or do we have to find a solution outside the user folder?

 

Thank you and Kind Regards

Ziyad

0 Likes
Reply
Accepted solutions (1)
366 Views
4 Replies
Replies (4)

Pineapple2024
Advocate
Advocate

https://help.autodesk.com/view/INVNTOR/2023/ENU/?guid=GUID-52422162-1784-4E8F-B495-CDB7BE9987AB

The following four locations are supported. You can choose any one of the four depending on the needs of your add-in. Your .addin file can exist in any one of the following four locations or any subdirectory. The "%XXXX%" portion of each of the paths is an operating system defined variable. When using Explorer you can enter it as part of the path and Explorer will evaluate it to use the actual path defined by the variable.

All Users, Version Independent
Windows 7/8.1/10 - %ALLUSERSPROFILE%\Autodesk\Inventor Addins\
All Users, Version Dependent
Windows 7/8.1/10 - %ALLUSERSPROFILE%\Autodesk\Inventor 20xx\Addins\
Per User, Version Dependent
In Window 7/8.1/10 - %APPDATA%\Autodesk\Inventor 20xx\Addins\
Per User, Version Independent
In Window 7/8.1/10 - %APPDATA%\Autodesk\ApplicationPlugins

0 Likes

JelteDeJong
Mentor
Mentor
Accepted solution

You could run a Powershell script like this after you have installed the addin.

$path = 'C:\ProgramData\Autodesk\ApplicationPlugins\test.addin'

$xml = [xml](Get-Content $path)

$node = $xml.SelectSingleNode('//Addin/Assembly')
$node.InnerText = $env:USERPROFILE + '\Company_SharePoint\InventorExporter.dll'

$xml.Save($path)

(Pro tip: You could do the complete installation using PowerShell)

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

ziyad_nuwayhid
Participant
Participant
Thank you for your reply Pineapple2024.
Sadly this does not suffice since we don't want to deploy the .dll's locally to the user, because then they would have to update their local file when we do updates to our AddIns.
We were hoping to have one central deployment folder, so that we only have to setup the addin files for each user initially.
0 Likes

ziyad_nuwayhid
Participant
Participant
This isn't quite what we want, but it comes closest. Thank you
0 Likes