Create a Add-in project, but the setup cannot work well.

T

Ted Lin

Dear all,
I use the VSTO 2005.
I create a new project, from [new project]->[C#]->[office]->[outlook add-in].
It creates two project on my solution.
(OutlookAddin1 project and OutlookAddin1Setup.)
I add a code in the startup function.
It shows a messgae box.
Then I try to run the project.
It can work and show me the above message box.
Then I rebuild the OutlookAddin1Setup, it successes.
I copy the setup.exe and OutlookAddin1Setup.msi to another computer.
I run the setup, and install successful.
Then I open the outlook 2003, but the message box donot show.
I make sure the outlook 2003 sp2 is the same as my computer.
Why the setup success, but the Add-in COM cannot work well?
Could you help me to find which step is wrong on my procedure?
Thanks.
 
P

Pete

There's quite a few things that can stop an add-in running. Check the
registry - go to the LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Outlook\AddIns
key, find your add-in and check the LoadBehaviour value. It should be 3. If
it's 2, it might be that an unhandled error occurred in the start up and
Outlook disabled it. If the key is missing, your setup project may be flawed.
That's the starting point.

Pete
 
K

Ken Slovak - [MVP - Outlook]

T

Ted Lin

Hi! Ken and Pete,

The loadBehavour value is 3, but if I open the outlook 2003.
The value will change to 2. How do I know what wrong in the add-in COM.
I just add one line like below:
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
MessageBox.Show("Test the Add-in COM.");
}
How do I find what error in my add-in COM.

I add the SetSecurity and install like O2003PIA, Langisage Package and so on.
I run the setup.exe to another computer.
Install success, but it is still cannot work well.
I find two warning logs in the application log.

ID: 63
Source: WinMgmt

A provider Offprov11 has been registered in the WMI namespace,
Root\MsApps11, to use the LocalSystem account. This account is privileged and
the provider may cause a security violation if it does not correctly
impersonate user requests.

I donot know why my installation is related with WMI.
I use the step by step as the document.
Is there are any security problem?
Could you lead me to fix this issue?
Thanks.


Ken Slovak - said:
If the project works on the development machine but not when deployed it's
almost always a matter of either not setting security on the project or not
making sure all the prerequisites are installed. Full trust must be set on
the installation folder.

See http://msdn2.microsoft.com/en-us/library/aa537173(office.11).aspx for a
walkthrough for deploying VSTO 2005 addins. For VATO 2005 SE addin
deployment see http://msdn2.microsoft.com/en-us/library/bb332051.aspx




Ted Lin said:
Dear all,
I use the VSTO 2005.
I create a new project, from [new project]->[C#]->[office]->[outlook
add-in].
It creates two project on my solution.
(OutlookAddin1 project and OutlookAddin1Setup.)
I add a code in the startup function.
It shows a messgae box.
Then I try to run the project.
It can work and show me the above message box.
Then I rebuild the OutlookAddin1Setup, it successes.
I copy the setup.exe and OutlookAddin1Setup.msi to another computer.
I run the setup, and install successful.
Then I open the outlook 2003, but the message box donot show.
I make sure the outlook 2003 sp2 is the same as my computer.
Why the setup success, but the Add-in COM cannot work well?
Could you help me to find which step is wrong on my procedure?
Thanks.
 
K

Ken Slovak - [MVP - Outlook]

I don't know why your addin is using the LocalSystem account, did you set
that up for some reason?

I've never had a problem with the deployment when following the steps from
the walkthrough, did you make sure the longest custom action line was all on
one line with each switch separated from the others by a space? In the
walkthrough that custom action is on multiple lines.

If you open the Framework 2.0 Configuration utility from the Control Panel's
Administrative Tools group do you see your addin listed under My Computer,
User, Code Groups, All_Code? If so does it have properties set to use a
strong name and to have full trust on the installation folder?
 
T

Ted Lin

Dear Ken,

I never set the LocalSystem account, I just create a new OutlookAddin
project, and step by step as the document said.

I try to find the Framework 2.0 Configuration utility, but no any new
seeting on the ALL_Code. Do it be the problem?

Maybe I can send my sample project to you, and you can see what happen?
Or you said you create it normal, could you give me a link or send me the
sample.
Let me try this issue.
Thanks.
 
K

Ken Slovak - [MVP - Outlook]

No, I don't want your project or installer.

If you don't see entries for your addin using the Framework configuration
utility then you've made some errors in your setup project where you set the
security, either in the custom actions or in strong naming or signing or
whatever.

I'd suggest using the configuration utility to set up the security manually,
which works just fine. Set up a new child entry under My Computer\Runtime
Security Policy\User\Code Groups\All_Code. Give it a name and set the
conditions for the code group as Strong Name. In the next wizard screen
click Import and select your addin dll. That should import the public key,
name and version of the dll. Grant the assembly full trust and then see if
the addin runs. If it does it's your security settings in the installer. If
it does not then I'd start looking at the prerequisites that need to be
there: Framework, Office and Outlook PIA's, VSTO runtime, stdole.dll,
extensibility.dll, any other requirements specific to your addin. Possibly
also you might need KB908002 if that computer installed Office 2003 before
Framework 2.0 was installed.
 
T

Ted Lin

Dear Ken,

Yes, I have tried to import my outlookaddin.dll in the Framework
configuration untility, but it still cannot work well.
I am not sure the target computer is install outlook 2003 first or framework
2.0 first.
But I install the VSTOR.exe, O2003PIA and Language Package to the target PC
first.
The PC is installed outlook 2003 sp2 and the OS is XP.
Someone tell me, maybe the CAS policy is not right.
Is it as the same the Framework configuration to import mu addin COM?

You said "Framework, Office and Outlook PIA's, VSTO runtime, stdole.dll,
extensibility.dll, any other requirements specific to your addin".
Do I show yop which version of the develop machine or target PC?
Thanks for your kindly support.
I am very confuse this problem.
^______^
 
T

Ted Lin

Dear Ken,
I download the KB908002 pack and install to my system.
The VS 2005 always break after I install the KB908002.
I use the Chinese version.
How can I uninstall the KB908002?
I cannot develop my program now.....
Thanks.
 
K

Ken Slovak - [MVP - Outlook]

Was your addin listed in the CAS security when you used the Framework
configuration utility? If not then your problem is that you didn't set the
CAS security policy correctly. In every addin I've installed that way the
addin does appear in the configuration utility. I don't know why what you
did isn't working, you'll have to track that down from the article.

You are strong naming the code assembly and using the Signing tab of the
project properties to sign your code?

Where I didn't bother setting security in the installer I was able to get
addins to run by getting the Framework configuration utility to set the
security.
 
K

Ken Slovak - [MVP - Outlook]

That can be removed by using Add/Remove Programs in the Control Panel.
 
T

Ted Lin

Dear Ken,

I rebuild a new enviroment to create the outlookadin project.
It works well.
I think the Chinese version is a problem.
Because my new enviroment is English version.
All my procedure is the same.
I donot know why I cannot develop in my Chinese Version enviroment.
However, I can do it now.
Thanks.
 
K

Ken Slovak - [MVP - Outlook]

For that question I'd suggest asking in the VSTO forum on MSDN. The VSTO
team members monitor that forum so you might get an answer about language
compatibility from the official source.
 
T

Ted Lin

Dear Ken,

Thanks for your reply.
I find a strange problem.
I have been finish my addin setup.
But it is just work well on XP+Outlook 2003.
If I want to install on Vista + Outlook 2003.
The installation will be fail.
I find an evntlog in the application eventlog.
Source:MsiInstaller
Event ID: 10005
Descript: OutlookAddin--<Error Message>
I make sure I have disabled the UAC and I login in with the administrator.
And run by "Run as administrator".
I search the "Events and Errors Message Center", but I cannot find anything
about this issue.
Do any problem is wrong about the above error?
Installer error? is it mean?
Thanks.
 
K

Ken Slovak - [MVP - Outlook]

I'm not an installer expert but a google search on that installer error code
turned up advice from someone at MS related to the same error when
installing Adobe Acrobat:

1. Open windows explorer.
2. Check permissions on c:\winnt\installer. Please make sure that the
following user accounts are provided with the given permissions:
System - full control
Everyone - read and execute
Administrator - full control
3. If you are unable to change the permissions, please rename the
c:\winnt\installer folder and reboot the system.
4. Now run the setup and check if the issue is resolved.

If that doesn't help I'd suggest posting the problem in one of the Windows
Installer support groups.
 
T

Ted Lin

Dear Ken,
Thanks for your help.
I have tried to rename the installer folder and reboot again.
I run my setup, but the result is the same.
I will post my problem to the windows installer support group.
But I have no idea about the group.
Could you give me a link?
Thanks .
 
K

Ken Slovak - [MVP - Outlook]

You can try microsoft.public.windows.msi. You also can try posting in the
VSTO forum on MSDN, that's monitored by the VSTO team so you may get a
better answer there than here.
 
T

Ted Lin

Thanks, I got it.


Ken Slovak - said:
You can try microsoft.public.windows.msi. You also can try posting in the
VSTO forum on MSDN, that's monitored by the VSTO team so you may get a
better answer there than here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top