none
Office Word AddIn Deployment using Windows Installer - Trusted Publisher RRS feed

  • Question

  • We are using VSTO 2010 and created a Office Word AddIn , we are using deployment approach by Windows Installer and created setup project by following all the instructions mentioned in MSDN Documentation - Deploying a Visual Studio 2010 Tools for Office Solution Using.

    Now the requirement is to sign the AddIn. What are possible ways to sign the add-in with sample / test trusted publisher's certificate while using windows installer approach? tried searching on web , but always got results for click once deployment. (already gone through link - http://msdn.microsoft.com/en-us/gg621207 but couldnt help much in this case).

    any pointers will be helpful.

     

     


    Bhushan | http://www.passionatetechie.blogspot.com | http://twitter.com/BhushanGawale
    Monday, February 6, 2012 7:03 AM

Answers

  • if you target .net 3.5 then you should do following:

    1. go with signing with certificate from trusted publisher (or create self signed and put it into trusted publishers)

    2. in windows installer custom steps add entry for your add-in to inclusion list of trusted VSTO solutions, something like this:

    string publicKey = "<RSAKeyValue><Modulus>your pub key</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
                var path = new FileInfo(Context.Parameters["assemblypath"]);
                Uri solutionLocation = new Uri(string.Format(@"file:///{0}/path to vsto.vsto", path.Directory.FullName.Replace("\\", "/")));
    
    
                var entry = new AddInSecurityEntry(solutionLocation, publicKey);
                if(!UserInclusionList.Contains(entry))
                    UserInclusionList.Add(entry);
    

    Monday, February 6, 2012 12:18 PM

All replies

  • using windows installer and VSTOR 2010 (and office 2010) you can circumvent problem with signing your solution by installing your add-in to %PROGRAMFILES% location. this way you do not need any certificates. Is that applicable for you?
    Monday, February 6, 2012 9:57 AM
  • Thanks DamianD for the reply.

    As approach is to use the Windows Installer , so files (Project Output) are getting deployed to %ProgramFiles% location.

    but still the test certificate is not added to the Trusted Publishers list of Word App. also when set up is run - publisher names is shown as unknown.

     


    Bhushan | http://www.passionatetechie.blogspot.com | http://twitter.com/BhushanGawale
    Monday, February 6, 2012 10:07 AM
  • if your target env is vstor2010 and .net 4 - drop that cert approach (do not sign your solution with it) and addin will be trusted by default.
    Monday, February 6, 2012 11:01 AM
  • not sure about end user's office version , but development has been done using VS 2010 / .NET 3.5 - and using Office Tools Word v9.0

    any comment on this?


    Bhushan | http://www.passionatetechie.blogspot.com | http://twitter.com/BhushanGawale
    Monday, February 6, 2012 11:18 AM
  • if you target .net 3.5 then you should do following:

    1. go with signing with certificate from trusted publisher (or create self signed and put it into trusted publishers)

    2. in windows installer custom steps add entry for your add-in to inclusion list of trusted VSTO solutions, something like this:

    string publicKey = "<RSAKeyValue><Modulus>your pub key</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
                var path = new FileInfo(Context.Parameters["assemblypath"]);
                Uri solutionLocation = new Uri(string.Format(@"file:///{0}/path to vsto.vsto", path.Directory.FullName.Replace("\\", "/")));
    
    
                var entry = new AddInSecurityEntry(solutionLocation, publicKey);
                if(!UserInclusionList.Contains(entry))
                    UserInclusionList.Add(entry);
    

    Monday, February 6, 2012 12:18 PM
  • Thanks again , 

    I guess this is needed when you are following the click once deployment approach , (installing add-in by double clikcing your vsto file).

    As I said , we are using Windows Installer approach to install the addin , so what is the procedure to register add-in to trusted location. am I missing some information?


    Bhushan | http://www.passionatetechie.blogspot.com | http://twitter.com/BhushanGawale

    Tuesday, February 7, 2012 6:26 AM
  • Code i gave you above is exactly for windows installer approach, which by the way is exactly what i'm using to deploy to my clients. So follow this approach and it will work.
    Tuesday, February 7, 2012 9:38 AM