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.
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’m not 100% sure what it is in Windows XP, but it’s probably%ALLUSERSPROFILE%.In any case, this folder should have permission to read/write and be the same for all users.
Don’t forget to create a subfolder for your company/application name: