Herman Solberg

Hi!

I've built an addin for Word 2007 that works just fin on XP with Office 2007 installed, but when I insatll it on a client running Vista I get a problem accessing files outside my assembly.

In my solution I've included an Xml file for storing and retrieving data. This file cannot be accessed on a machine running Vista. I get a "File access denied" error when Word starts up. I'm guessing it has something to do with security settings since it works just fine after I have disabled UAC.

There's gotta be some way to solve this during installation, right Does anyone have any suggestions

Help is always greatly appreciated.

//Herman




Re: Visual Studio Tools for Office Deploying Word 2007 addin on Vista - File Access problem

Romain Vailleux

Hi,

I think that you are right, the problem seems to come from the UAC and addin permissions.

Where is your XML configuration file stored If it's in the Program File folder, sure the permission for the addin definitely could be the source of your difficulties.

You should have a look to this page : http://weblogs.asp.net/mnissen/articles/427490.aspx which describes how to build an intaller class which adds full trust permissions to the .NET runtime security policy for the addin during the windows intaller installation.

You might find some more explanation in the MSDN sample http://msdn2.microsoft.com/en-US/library/bb332051.aspx (the SetSecurity class in particular).

Hope it will help...

Regards,






Re: Visual Studio Tools for Office Deploying Word 2007 addin on Vista - File Access problem

Herman Solberg

Thanks a lot for the tip Romain!

This guy Mads seemed to know a lot about installation issues regarding VSTO addins. Unfortunately I didn't find anything that addressed my problem.

I've followed all the instruction in the MSDN walkthrough that you posted aswell, so there must be a specific issue with Vista and UAC that much be addressed during installation. If I'm not mistaken, the walkthrough sample gives "Full Trust" to the specified assembly, which should be enough to access an Xml file that is placed in the same directory.

Is there something about VSTO addins and Vista that I'm missing Feel free to fill in the blanks anyone...

//Herman






Re: Visual Studio Tools for Office Deploying Word 2007 addin on Vista - File Access problem

Herman Solberg

Without any luck searching for a solution I once more turn my attention back to this magnificant forum for help.

Does anyone know what could be causing the problem described above. Help is always greatly appreciated.

//Herman






Re: Visual Studio Tools for Office Deploying Word 2007 addin on Vista - File Access problem

Andrew Cherry [MSFT]

Hi Herman -

I'll take a wild guess here:

Is your solution (and your xml file) being placed in %ProgramFiles%

I seem to recall that Vista only permits read-only access to Program Files without elevated permissions (Office applications, by default, would load with standard permissions). If that is the case, I would recommend that you move the XML file into a user's application data directory (otherwise, the XML file would be shared for all users anyway). Assuming that it is a Vista security issue, that may clear it up.

Otherwise, if you could have a debugger attached on Vista and provide the exception details, we may be able to investigate further.

Thanks,

Andrew