0
votes

How can I build a common installer for office 2007 / 2010 and 2013 ?

There are difference in csproj files (There are different host packages ids)

What is the best way to build a common addin that will work on all the hosts of Addins ?

I have tried the following - I created an addin application for 2007 in Visual studio 2010. I was able to build a installer using Setup project(msi) in VS2010. It worked well with outlook 2007 and 2010. (Made registry changes / file setups).

This link was useful : http://msdn.microsoft.com/en-us/vsto/ff937654.aspx

The installation with Click once was useful. Since there were some additional files which I had to include. So selected custom installers.

Now the next step was 2013. I used the same installer on 2013. It crashes. I get an exception indicating a stack overflow.

Note : I have developed the application using Visual studio 2010 for OUtlook 2007 and 2010 addin using C#

1
Show your work. What have you found so far? What solutions have others suggested? - Bob Dalgleish
Updated my original post. - Sania Programmer

1 Answers

1
votes

In fact, you have asked two questions in one! here the answers:
How can I build a common installer for office 2007 / 2010 and 2013 ?
This is not an issue at all, there is no need to have different installers for each version of office (except for x86 & x64 office bitness if you are making a per-machine setup). If you are using specific features for each version of office, you can check, in your add-in code, the version of office, by using Application.Version.
What is the best way to build a common addin that will work on all the hosts of Addins ? I think you mean: What is the best way... all the hosts of Office ? You can accomplish this in 2 ways:

  • By using the commercial product Addin Express or,
  • By creating a shared add-in (unfortunately, dropped since VS 2012), however you still be able to create it manually by creating a Class Library project, once created add a class that implments the Extensibility.IDTExtensibility2 interface, if you are planning to support ribbons in your addin, then implement the IRibbonExtensibility as well. Also, add references to Office.dll and Extensibility.dll. at the end you should have something similar to this:

    [GuidAttribute("1AF54C8F-6E33-44DE-9B4A-FF3801A51104"), ProgId("MyAddin.Connect")]

        public class Connect : Object, Extensibility.IDTExtensibility2, IRibbonExtensibility
        {
            private object applicationObject;
            private object addInInstance;
    
            public Connect()
            {
    
            }
    
            public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom)
            {
                applicationObject = application;
                addInInstance = addInInst;
            }
    
            public void OnDisconnection(Extensibility.ext_DisconnectMode disconnectMode, ref System.Array custom)
            {
            }
    
            public void OnAddInsUpdate(ref System.Array custom)
            {
            }
    
            public void OnStartupComplete(ref System.Array custom)
            {
            }
    
            public void OnBeginShutdown(ref System.Array custom)
            {
            }
    
            public string GetCustomUI(string RibbonID)
            {
                StreamReader customUIReader = new System.IO.StreamReader(
                @"APP\PATH\Ribbon.xml");
    
                return customUIReader.ReadToEnd();
            }
    
            public void onMsoCommand(Office.IRibbonControl control, ref bool Cancel)
            {
    
            }
        }
    

BTW, this my first answser here on SO, hope it helps!