How to add “MS Visual Studio 20xx Tools for Office Runtime”?

I recently developed a minor Excel 2010 Add-in in the Visual Studio 2011 beta and tried to deploy the solution right now. I selected the .NET Framework 4 as a prerequisite and setup.exe downloads it, if it is not yet installed on the target computer.

But I am getting headaches when trying to catch the "Tools for Office Runtime" into the dialog "Prerequisites" in the Publish tab when building. The strange thing is: In my Office, there was an old 2010 Visual Studio installation, that HAS this setting, I can select the entry, build it and voilá: The runtime is downloaded.

How can I tell Visual Studio: Look, I need this runtime, please check it before installing it. Because right now, setup.exe installs the add-in and it crashes on the first Excel start.

Futher information:

  • I use click-once deployment
  • C# VSTO add-in
  • Targetting Excel 2010

Edit

I think I found a solution for this:

  • I copied the VSTOR4 directory from my office PC located at ''C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages'' and placed it on my developer notebook at the same location. Result: not found
  • I copied it to ''C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages''
  • I edited my project.csproj to include the following setting:
 <BootstrapperPackage Include="Microsoft.VSTORuntime.4.0">
      <Visible>False</Visible>
      <ProductName>Microsoft Visual Studio 2010 Tools for Office Runtime %28x86 and x64%29</ProductName>
      <Install>true</Install>
 </BootstrapperPackage>

The question is: Is this really the right way? Will there be problems that I didn't think of right now? Why isn't there an option to just download additional bootstrappers (there is, but for .NET 2.0 and some MDAC component I don't use)?

VSTO deployment just is painful as it is and not straight forward comparing to a simple "MSI Installer, done" procedure. Having to deal with these kind of issues really makes me kinda uncomfortable about the whole add-in architecture, but that's another story for another day.

Answers


Although you did it manually, it will work fine. Alternately you can go to project properties, Publish tab and click the pre-requisites button to bring up the pre-requsites dialog where you should be able to see VSTOR40 along with other bootstrapper components. If you don't see a particular one there, two possible reasons could be:

  • You don't have the bootstrapper package in your C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages folder (replace with v7.0 for VS2010)

  • Your product.xml (available in the above location) contains incorrect information.

One side note: You should check your product.xml file for HomeSite attribute and make sure you have that set to proper "fwlink" provided by Microsoft for that package. fwlinks are basically persistent web links from where a package can be downloaded by the ClickOnce installer, so that you don't have to distribute it with your product. Use Google to find out fwlinks of different bootstrapper packages.


Need Your Help

Preferred way of checking for errors

language-agnostic exception error-handling

If I want to say, check that an int is between two certain numbers, would it be better to implement it without exceptions like so:

header title with php when download files

php header download title

Im using php to stream videos from my site , example of video url

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.