Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Modify VSTO addin's manifest to work it as Invoker (http://www.outlookbanter.com/outlook-vba/62720-modify-vsto-addins-manifest-work.html)

Dhananjay December 7th 07 01:47 PM

Modify VSTO addin's manifest to work it as Invoker
 
Hi All,
I have developed one COM- addin in VSTO / VB 2005 / Office 2007. As we
know that, if we create a VSTO addin, then it is having manifest file
as well. As I have been told that, I should add UAC manifest to my
application, please can anybody tell me how to modify VSTO addin's
manifest file, so that I can use my addin as a "Invoker".

Thanks,
Dhananjay

Ken Slovak - [MVP - Outlook] December 7th 07 02:50 PM

Modify VSTO addin's manifest to work it as Invoker
 
See
http://msdn2.microsoft.com/en-us/lib...W indowsVista
in the deployment article for VSTO that I pointed you to. It has the
information needed for deployments on Vista.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Dhananjay" wrote in message
...
Hi All,
I have developed one COM- addin in VSTO / VB 2005 / Office 2007. As we
know that, if we create a VSTO addin, then it is having manifest file
as well. As I have been told that, I should add UAC manifest to my
application, please can anybody tell me how to modify VSTO addin's
manifest file, so that I can use my addin as a "Invoker".

Thanks,
Dhananjay



Dhananjay December 17th 07 11:42 AM

Modify VSTO addin's manifest to work it as Invoker
 
Thanks Ken, for your valuable reply.
I downloaded SDK & used orca to change the msi to "UAC Compliant".
Now it is not showing me the UAC dialog for "An unidentified program
wants to access your computer". Thanks for it.
But I want to modify my VSTO addin's manifest, so that I can run my
addin as a Invoker.
Basically, my addin writes the trace in the application directory.
This is my snippet for writing trace.txt file

Try
Dim fs As System.IO.StreamWriter
fs = IO.File.AppendText(AppPath & "\Trace.txt")
fs.WriteLine(Now & ": " & st)
fs.Close()
fs = Nothing
Catch ex as Exception
......

Everytime there is an exception while writing to trace.txt file.
Someone told me that If my addin runs as a Invoker, then there will be
no problem.
Also I can not force to the client to install my addin in
AppDataFolder, so client installs the addin in "Program Files", where
my trace file is not generated.
I have set permission for my addin as "FullTrust" as required. I used
"SetSecurity" project for that.
Meanwhile, your project works fine on my machine after I changed your
FolderPP class to inherit from "System.Windows.Forms.UserControl" in
place of "System.Windows.Forms.Form".

Thanks again,

Ken Slovak - [MVP - Outlook] December 17th 07 02:34 PM

Modify VSTO addin's manifest to work it as Invoker
 
In almost all cases on Vista a program has no permissions to write to the
Program Files hierarchy. It's also considered to be not a best practice to
do that even where the OS doesn't prevent writing there. The best practice
is considered to be writing things such as error logs to LocalAppData.

I'm not sure what you mean about changing the FolderPP class to inherit from
UserControl, that's what it does now. The first code line in FolderPP.CS
(and the equivalent in VB.NET) is:

public partial class FolderPP : UserControl
{

Which to me indicates that it inherits from
System.Windows.Forms.UserControl.

Can you explain what you're seeing and what you're doing?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Dhananjay" wrote in message
...
Thanks Ken, for your valuable reply.
I downloaded SDK & used orca to change the msi to "UAC Compliant".
Now it is not showing me the UAC dialog for "An unidentified program
wants to access your computer". Thanks for it.
But I want to modify my VSTO addin's manifest, so that I can run my
addin as a Invoker.
Basically, my addin writes the trace in the application directory.
This is my snippet for writing trace.txt file

Try
Dim fs As System.IO.StreamWriter
fs = IO.File.AppendText(AppPath & "\Trace.txt")
fs.WriteLine(Now & ": " & st)
fs.Close()
fs = Nothing
Catch ex as Exception
.....

Everytime there is an exception while writing to trace.txt file.
Someone told me that If my addin runs as a Invoker, then there will be
no problem.
Also I can not force to the client to install my addin in
AppDataFolder, so client installs the addin in "Program Files", where
my trace file is not generated.
I have set permission for my addin as "FullTrust" as required. I used
"SetSecurity" project for that.
Meanwhile, your project works fine on my machine after I changed your
FolderPP class to inherit from "System.Windows.Forms.UserControl" in
place of "System.Windows.Forms.Form".

Thanks again,



Dhananjay December 18th 07 05:51 AM

Modify VSTO addin's manifest to work it as Invoker
 
Hi Ken!
I downloaded your project from the site you mentioned viz.
http://www.slovaktech.com/outlook_2007_templates.htm & the project zip
name is VSTO_VBNETAddin.zip.
After that when I opened your project, in FolderPP.Designer.Vb file I
can see very first 3 lines are -

Global.Microsoft.VisualBasic.CompilerServices.Des ignerGenerated() _
Partial Class FolderPP
Inherits System.Windows.Forms.Form

That means you are inheriting from System.Windows.Forms.Form & not
from UserControl.
I just changed that line to inherit from UserControl.
Any way, Thanks a billion for your valuable reply, which solves my
problem of property page.

Thanks again,
Dhananjay

Ken Slovak - [MVP - Outlook] December 18th 07 04:49 PM

Modify VSTO addin's manifest to work it as Invoker
 
Hmm, the copy of the project I have here (and that I wrote) inherits from
System.Windows.Forms.UserControl, not from Forms.Form.

It looks like VS did something when I exported the project as a project
template and changed my original inheritance from UserControl to Form.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Dhananjay" wrote in message
...
Hi Ken!
I downloaded your project from the site you mentioned viz.
http://www.slovaktech.com/outlook_2007_templates.htm & the project zip
name is VSTO_VBNETAddin.zip.
After that when I opened your project, in FolderPP.Designer.Vb file I
can see very first 3 lines are -

Global.Microsoft.VisualBasic.CompilerServices.Des ignerGenerated() _
Partial Class FolderPP
Inherits System.Windows.Forms.Form

That means you are inheriting from System.Windows.Forms.Form & not
from UserControl.
I just changed that line to inherit from UserControl.
Any way, Thanks a billion for your valuable reply, which solves my
problem of property page.

Thanks again,
Dhananjay



Ken Slovak - [MVP - Outlook] December 18th 07 05:07 PM

Modify VSTO addin's manifest to work it as Invoker
 
I posted a fixed version of that template on my Web site. It looks like
somehow VS changed the inheritance in both the ToolsOptionsPP and FolderPP
designer classes from UserControl to Form inheritance. That wasn't done in
the C# projects or the shared addin project for VB.NET.

Anyway, the projects on my Web site are now correct.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ken Slovak - [MVP - Outlook]" wrote in message
...
Hmm, the copy of the project I have here (and that I wrote) inherits from
System.Windows.Forms.UserControl, not from Forms.Form.

It looks like VS did something when I exported the project as a project
template and changed my original inheritance from UserControl to Form.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Dhananjay" wrote in message
...
Hi Ken!
I downloaded your project from the site you mentioned viz.
http://www.slovaktech.com/outlook_2007_templates.htm & the project zip
name is VSTO_VBNETAddin.zip.
After that when I opened your project, in FolderPP.Designer.Vb file I
can see very first 3 lines are -

Global.Microsoft.VisualBasic.CompilerServices.Des ignerGenerated() _
Partial Class FolderPP
Inherits System.Windows.Forms.Form

That means you are inheriting from System.Windows.Forms.Form & not
from UserControl.
I just changed that line to inherit from UserControl.
Any way, Thanks a billion for your valuable reply, which solves my
problem of property page.

Thanks again,
Dhananjay





All times are GMT +1. The time now is 03:41 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com