This project has moved. For the latest updates, please go here.

Deploying Outlook Addin to LOCAL_MACHINE

Sep 27, 2013 at 4:14 PM
First I want to say that it is a great project.

I'm developing an Outlook addin for archiving outgoing mails.
It is installed by a software distributor system, so I need to install for all users on a target maschine.
My try:

[COMAddin("add1 Addin", "This is the DMS Addin V.0.1.5.", 3)]
public class add1 : COMAddin ...
After registration(with regasm), a key is generated : CURRENT_USER\Software\Microsoft\Office\Outlook\AddIns\addins.dmsidx. Except the standard value nothing in it.
Note that it is under CURRENT_USER. Under LOCAL_MACHINE is no key generated.

With [RegistryLocation(RegistrySaveLocation.CurrentUser)] is the addin registered under the same key correctly and functioning properly. Unfortunately, of course, only for the current user.

The developer environment is XP/32 but the same effect occurs on a test target machine with Win7/64. NetOffice version is 1.6.0.

Does anyone have an idea what is going wrong?

Thanks in advance

Sep 29, 2013 at 11:03 PM
looks like a bug. i want check and fix this tomorrow! (monday) thanks for pointing this out.

Sep 30, 2013 at 9:31 PM
i confirm the horrible bug. i fix the bug and add NetOffice 1.6.1 to the download section. (upload is currently in progress)
its marked as preview because its only source/assemblies/examples/tutorial for .NET 4.
i need few days to create a fully loaded release with all improvements and .net versions.
if you need another .net version i suggest you to replace the register/unregisters methods with the NetOffice RegisterFunction attribute and the replace argument (tools addin - extended example).

Oct 2, 2013 at 5:59 PM

Thanks for the fix, quiet same pb I think..
Due to company security restriction, I have to install with adm account.. and make it available for all users.
COMAddin examples work fine after modification to Registry.LocalMachine.. but not possible to get same behaviour from NetOffice Tools ones.
Tried to play a bit with src when modifying mother class NetOffice.PowerPointApi.Tools.COMAddin RegisterFunction meth
RegistryKey key = Registry.ClassesRoot.CreateSubKey("CLSID\\{" + type.GUID.ToString().ToUpper() + "}\\InprocServer32\\" + GetAssemblyVersionString(type.Assembly));
replaced by
RegistryKey key = Registry.ClassesRoot.CreateSubKey("CLSID\\{" + type.GUID.ToString().ToUpper() + "}\\InprocServer32");
location bifurcation as follow
RegistryKey regKeyWord = null;
Registry.ClassesRoot.CreateSubKey(@"CLSID\{" + type.GUID.ToString().ToUpper() + @"}\Programmable");
if (location.Value == RegistrySaveLocation.LocalMachine)
    Registry.LocalMachine.CreateSubKey(_addinOfficeRegistryKey + progId.Value);
    regKeyWord = Registry.LocalMachine.OpenSubKey(_addinOfficeRegistryKey + progId.Value, true);
    Registry.CurrentUser.CreateSubKey(_addinOfficeRegistryKey + progId.Value);
    regKeyWord = Registry.CurrentUser.OpenSubKey(_addinOfficeRegistryKey + progId.Value, true);
but.. still no good result.
Will check then your fix, cool to find it just at the end of the day!

NB: really nice job this project!
Oct 2, 2013 at 6:14 PM
not sure i'm understand the problem..
you mean COMAddin still doesnt create the reg keys in local machine?

Oct 2, 2013 at 6:49 PM
Hi Sebastian,

Good fix this 1.6.1 modulo little modif to follow evolution of NetOffice.PowerPointApi.Tools.ITaskPane.OnConnection, at least on powepoint examples.

"NetOffice Tools - Simple", NetOfficeTools.SimplePPointCS4.dll, works fine... congrats !

But "NetOffice Tools - Extended", NetOfficeTools.ExtendedPPointCS4.dll, still doesn't :-o
-> admin account it is fine, task pane and ribbon with smilley are loaded
-> user account.. not even listed in COM add-ins list of PPT..

Sehr schön Reaktivität!
Oct 2, 2013 at 7:15 PM
oh yes i know, the ITaskpane->OnConnection has a third argument Office._CustomTaskpane parent because you have set with or height/visible for your panel control here and think its easier with these argument. its fixed in the full release, i currently working on it.

i test the machine key load problem today and give you request immediately.

Oct 2, 2013 at 7:35 PM
Do not worry Sebastian, here in Bavarian we are already in long we.. then can wait up to next week!
Another question.. is there a system to install add-in just for the current user, ie without admin right / unable to modify root registry key..?
If it is the case, would it be possible to pass as class attribute such option, following registry location one?
Kind regards,
Oct 2, 2013 at 9:12 PM
okay weils schon spät ist mach ich jetzt in deutsch weiter.
mein test für das extended sample ist wunderbar verlaufen, keine probleme. die taskpane die du siehst kommt doch auch aus dem extended sample. die simple variante bietet keine taskpane und auch keine ribbon buttons. daher verstehe ich jetzt nicht so recht das du meinst das extended sample wird nicht geladen. scheinbar ja doch.

die frage nach den admin rechten und dem current user kann ich aus dem kopf gerade nicht beantworten. es gibt ein deplyoment(.msi) sample im download bereich das dass assembly im gac registriert und msi die office keys im current user der office anwendung eintragen lässt. ausserdem übernimmt msi gleich die com registrierung, ruft dabei aber nicht die statischen register funktionen auf (das kann msi nur mit unmanaged addins). wenn das ohne admin rechte nicht klappt dann seh ich da auch keinen weg. das problem sind auch weniger die keys im current user der office andwenung sondern das registerieren des assemblies als systemweite com componente(com kennt keine user einschränkungen) und fallweise das registrieren des assemblies im GAC.

Oct 2, 2013 at 10:25 PM
Hum.. sorry but not so at ease in German.. sounds interesting but would take long to me to translate everything and avoiding mistakes :-o
Kind regards,
Oct 4, 2013 at 6:44 PM
okay once again.

my test works glady. you told me you see the taskpane and the happy face buttons. this buttons and pane comes from the extended sample and and i'm dont understand why you say the extended sample is not working in office.

about the admin rights:
not sure but please try the netoffice msi deployment sample(in the download sections, c# and vb available). these sample deploy project register the addin assemby in GAC and set the office specific addin hive keys at hand.(msi register the addin for the COM runtime also) msi doesnt call the static register/unregister methods in your addin(this is only available for unmanaged addins. this is why you have to create the office keys at hand in the deployment project) if this is not working you have no chance to deploy an addin without admin rights. the security issue is not the office keys. as far i know you can modify the current user hivekey without admin rights. the problem is to register the addin as COM component for the complete machine(COM cant register a component just for the user) and register the assembly in GAC.

nice to know:
its not nessecary to register an addin in the global assembly cache. but if you dont do that you to create a sepific codebase entry in the local machine registry. now, mscorlib knows the location of the assembly. you can do that with regasm on you local machine and the /codebase argument but of course this not usable for deployment. what is your deployment strategy?? the comaddin base class in NO try to create the codebase machine in the register method key but of course an exception occured without admin rights(may i can do that better and try do detect for GAC registration/admin rights and dont try to create this key)

Oct 10, 2013 at 4:35 PM

Just a bit more precision dealing with what is not working to me.
Both NetOffice ppt examples are deployed thanks to Inno setup, one given on this forum.
Then both addin are loaded and available if I run ppt as admin, whereas just the simple one is correctly loaded when ppt is launched as normal user.
As normal user there's then no taskpane neither happy face buttons.. :-o

Thanks for complementary info, will try to understand them at next coffee pause ;)

Kind regards,
Oct 11, 2013 at 8:46 AM

Deployment strategy would consist in providing to enduser the addin and ask them to do the installation, ie with limited rights.
If admin rights are needed, could still be ok.. but just for installation and not for launching ppt..

You gave me an intuition about inno setup file: in the example given in the forum you could add "PrivilegesRequired" param to let user go through the installation process. Here is the complete file used:
Source: bin\Release\NetOfficeTools.ExtendedPPointCS4.dll; DestDir: {app}
Source: bin\Release\NetOffice.dll; DestDir: {app}
Source: bin\Release\OfficeApi.dll; DestDir: {app}
Source: bin\Release\PowerPointApi.dll; DestDir: {app}
Source: bin\Release\VBIDEApi.dll; DestDir: {app}
Filename: "{dotnet40}\regasm.exe"; Parameters: /register /codebase /tlb NetOfficeTools.ExtendedPPointCS4.dll; WorkingDir: {app}; StatusMsg: "Registering Addin."; Flags: runminimized
Filename: "{dotnet40}\regAsm.exe"; Parameters: /unregister NetOfficeTools.ExtendedPPointCS4.dll; WorkingDir: {app}; StatusMsg: "Unregistering Addin."; Flags: runminimized
But.. doesn't change the thing.
Here is a test result tab, KO means that the addin is not loaded (ribbon Developer > Com addins)
NB: 3 OK and 5 KO
            installation admin      installation local
ppt admin   netoffice simple OK     netoffice simple KO
            netoffice extended OK   netoffice extended KO
ppt local   netoffice simple OK     netoffice simple KO
            netoffice extended KO   netoffice extended KO
Kind regards,
Oct 21, 2013 at 12:40 PM
i create NO 1.7(alpha preview) today with new code and diagnostics(in the download section). i create 2 new addin main tests to see how it works and looks good. you want tryout this and gimme response. please also let me know: this works not on your system or the developer system?
Nov 4, 2013 at 9:08 AM

I dev an addin (re)offering PowerPoint hidden format as html and mhtml, thx to your great job it is working fine on my personnal laptop (Win7 32bit).
But then, at work, it is not working so fine.. WinXP 32bits with strong restriction on normal user.
The only way to get it working properly is installation admin / ppt admin.. a bit constraining for my colleagues :-o
I should use de diagnostic tool to follow the load process.. but already wondering why I don't see my addin in tab Developer > COM Add-Ins when launching ppt in local mode..

Kind regards,
Oct 2, 2014 at 5:18 PM

i have the same issue as andyluiz. I cant find the 1.6.1 download under the downloads section.

Where can i get it?

Thanx for the help and for this great project.
Oct 4, 2014 at 6:22 AM
This is a known NO bug specialy on 64Bit systems :( I suggest you as hotfix to overwrite the register methods and create the reg keys at hand. I'm very very sorry :(
No idea how this happen :( but i want fix this.