Where should the System.AddIn pipeline be installed?

I have a regular old Windows Forms application with a WiX installer, and it is installed for all users in the Program Files folder, as you would expect. The application hosts add-ons using the System.AddIn framework .

Since the System.AddIn structure needs to write some of the add-in pipeline folders ( AddIns , AddInSideAdapters , AddInViews , Contracts and HostSideAdapters ), I don’t know the best place to install add-ons. I cannot install on Program Files because the user will not have write permissions, and if I install it in the user’s Application Data folder, then the add-ons will not be installed for other users.

I understand that there are conflicting requirements (users cannot interact with add-ons of other users, add-ons must be installed for all users, and all users require write permission), but what is the best practical route to take?

It is a shame that the files that the System.AddIn structure should write cannot be stored separately in Application Data , but this is apparently a limitation of the scope.

+4
source share
4 answers

I know this question was asked a long time ago, but ...

Have you tried Environment.SpecialFolder.CommonApplicationData?

In Vista / Windows 7, this folder is %ProgramData% . I am not 100% sure that this is on Windows XP, but it is probably %ALLUSERSPROFILE% .

In any case, this folder must have read / write permission and be the same for all users.

Remember to create a subfolder for your company / application name:

 string companyName = "My Company"; string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData); string path = Path.Combine(folderPath, companyName); 
+2
source

Still hoping for a better answer, but I think the only way to do this is to install the pipeline in Program Files and copy to Application Data every time the application is launched. Then you must point the System.AddIn infrastructure to the pipelined copy in Application Data so that it only tries to write to the user profile.

+1
source

Uh, you cannot have “all users” or “no height”. I don’t know exactly what System.AddIn is, but if it is designed to run from a user process (aka: not system service like process), then it should write in the user profile (ApplicationDataFolder is a great place), This is a very fundamental rule, which all applications should follow. Based on my limited understanding of your comments, it seems like System.AddIn is breaking this rule.

But I probably just missed something.

0
source

Do you need to use the WiX installer? Deploying the application as a clickonce solution will place the entire pipeline in the user applications data folder. Thus, each user can save his own list of modules.

It will also bypass the restrictions for writing to the folder.

0
source

All Articles