views:

218

answers:

3

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

Because the System.AddIn framework needs to write to some of the add-in pipeline folders (AddIns, AddInSideAdapters, AddInViews, Contracts and HostSideAdapters) I don't know the best place to install the add-ins to. I can't install to Program Files because the user won't have write permission, and if I install to the user's Application Data folder then the add-ins won't be installed for any other users.

I realise that there are conflicting requirements here (users can't mess with other users' add-ins, the add-ins need to be installed for all users and all users need permission to write) but what is the best practical route to take?

It's a shame that the files the System.AddIn framework needs to write can't be stored separately in Application Data, but that seems to be a limitation of the framework.

A: 

Uhh, you can't have both "all users" and "no elevation". I don't exactly know what the System.AddIn framework is but if it is intended to be run from a user process (aka: not a system service like process) then it must write under the user profile (ApplicationDataFolder is a great place). That is a very fundamental rule that all applications must follow. Based on my limited understanding from your comments, it sounds like the System.AddIn framework is breaking that rule.

But I'm probably just missing something.

Rob Mensching
I think we're missing the same thing, hence my question. :)
GraemeF
A: 

Still hoping for a better answer, but I think the only way to do it is to install the pipeline to Program Files and copy to Application Data each time the application is run. You would then point System.AddIn framework to the pipeline copy in Application Data so it only attempts to write to the user profile.

GraemeF
I think your approach is right. Copy the "default" AddIns to the user's application data as long as there are no existing AddIns.
VVS
A: 

Are you required to use the WiX installer? Deploying your app as a clickonce solution will put all of the pipeline into the users application data folder. This way each user can keep their own list of modules.

This will also get around the writeable folder restriction.

AdamSane
The same goes for Windows Installer if each user installs it, but that's not what I'm looking for.
GraemeF