Lily Collins

I¡¯ve developed an add-in using VSTO SE and Outlook 2007. I have a setup project and have followed all the instructions given in the following msdn articles to try to deploy the add-in:

http://msdn2.microsoft.com/en-us/library/bb332051.aspx (Deploying Visual Studio 2005 Tools for Office Second Edition Solutions Using Windows Installer (Part 1 of 2))

http://msdn2.microsoft.com/en-us/library/bb332052.aspx (Deploying Visual Studio 2005 Tools for Office Second Edition Solutions Using Windows Installer (Part 2 of 2))

The add-in obviously loads when I'm debugging but I am now trying to load the full install on my PC and another user's PC before releasing to other users.

I set up the msi and setup.exe as instructed, including VSTO SE runtime, 2007 PIAs and .NET 2.0 as prerequisites. This didn¡¯t work as despite the VSTO runtime being loaded - the launch conditions said that the VSTO runtime wasn¡¯t installed. I checked that VSTO runtime was installed.

I made sure I had all the necessary prerequisites and I set up the msi without any of the prerequisites.

Now when I try to install I get the following message, which stops installation:

¡°Cannot set the security policy. The specified solution code group name is not valid¡±

I have included the following as the CustomActionData in the Install method of the custom action to grant trust (this is a sample custom action provided by Microsoft ¨C in the SetSecurity project)

/assemblyName="OutlookAddIn.dll" /targetDir="[TARGETDIR]\"/solutionCodeGroupName="MyTest.OutlookAddIn"/solutionCodeGroupDescription="Code group for OutlookAddIn"/assemblyCodeGroupName="OutlookAddIn"/assemblyCodeGroupDescription="Code group for OutlookAddIn"/allUsers=[ALLUSERS]

It doesn¡¯t like the solutionCodeGroupName and the exception is thrown because it says the solutionCodeGroupName is null or empty.

What am I doing wrong



Re: Visual Studio Tools for Office Deployment VSTO SE - Outlook 2007 add-in

Lily Collins

Would it be possible to do the install manually, i.e. without the msi and setup.exe generated by the setup project I need to get this working to test the add-in on non development PCs.

Any help is gratefully received.





Re: Visual Studio Tools for Office Deployment VSTO SE - Outlook 2007 add-in

Lily Collins

I went back to basics and created a very simple project with a one line MessageBox statement (as per the sample - http://msdn2.microsoft.com/en-us/library/bb332052.aspx). I was able to create the MSI without any issue (I didn't include any prerequisites so ignored that particular section of the sample).

I noticed a few differences between the simple project and my add-in setup, namely:

  1. I had removed the prerequisite for .NET Framework 2.0 (get to this by selecting Prerequisites on SetUp project's Properties);
  2. I had changed the option to download prerequisites from the component vendor's website to download prequisites from the same location as my application (again on the SetUp project Prerequisites page, as 1 above);
  3. When creating the CustomActionData for Install (to grant trust to the assembly) I had removed what I thought were superfluous spaces when I created the single line CustomActionData value.

I changed the above 3 things, i.e. added .NET Framework 2.0 as a prerequisite, reset to download prerequisites from the component vendor's website and aside from changing the MyCompanyName and add-in name, and keeping a single line, I left the CustomActionData value as it was in the sample (no spaces added or removed).

The msi worked. I verified that the correct manifest was shown in Tools - Trust Center - Add-ins and the add-in worked as intended.

A little knowledge was a dangerous thing in this instance as I obviously changed things that I should have left alone until I completely understood what I was doing.





Re: Visual Studio Tools for Office Deployment VSTO SE - Outlook 2007 add-in

Malleswar

Hi Lily,

Have u found the solution. I am also getting the same message.

cannot set the security policy.The specified solution code group name is not valid

I copied the part of code setsecurity.cs where the exception is coming.


Code Snippet

string allUsersString = this.Context.Parameters["allUsers"];
string solutionCodeGroupName = this.Context.Parameters["ExcelAddin3"];
string solutionCodeGroupDescription = this.Context.Parameters["solutionCodeGroupDescription"];
string targetDir = this.Context.Parameters["targetDir"];
string assemblyName = this.Context.Parameters["assemblyName"];
string assemblyCodeGroupName = this.Context.Parameters["assemblyCodeGroupName"];
string assemblyCodeGroupDescription = this.Context.Parameters["assemblyCodeGroupDescription"];

// Note that a code group with solutionCodeGroupName name is created in the
// Install method and removed in the Rollback and Uninstall methods.
// The solutionCodeGroupName must be a unique name to ensure that the
// correct code group is removed during Rollback and Uninstall.

if (String.IsNullOrEmpty(solutionCodeGroupName))
throw new InstallException("Cannot set the security policy. The specified solution code group name is not valid.");



if you could find the solution, please guide me.

Thanks in Advance.





Re: Visual Studio Tools for Office Deployment VSTO SE - Outlook 2007 add-in

Lily Collins

Sorry for taking so long to get back to you. Yes I did find the solution - it's listed in the post above yours.