How to redistribute Visual Studio 2010 Tools for Office Runtime with InstallShield correctly?

RomanVD picture RomanVD · Apr 7, 2013 · Viewed 12k times · Source

Using: VS 2012, InstallShield 2012 Spring Express

For my Excel Add-In I need to redistribute to prerequisites: - Microsoft .NET Framework 4.5 Full - Visual Studio 2010 Tools for Office Runtime

There is no problem with .NET Framework in any case. I redistribute it by setup or by web download. Everything is OK.

But with VSTO I've got some troubles: 1) "web download" is not working properly. Even if I use this recommendations - http://msdn.microsoft.com/en-us/library/vstudio/cc442767.aspx#Configure

After all, I downloaded vstor_redist.exe (~40 Mb) and added it to setup. 2) The setup starts to install vstor_redist.exe and really does it! But then I see a strange InstallShield message that VSTO installation appears to have failed. Nevertheless after installation the application works correctly.

Two questions: How to redistribute VSTO with web download option? How to avoid the appearance of useless "installation failed message"? It seems these are InstallShield bugs...

Roman

Answer

AlBear picture AlBear · Oct 24, 2013

In my case (Windows 8 x64 - Office x64 - Installshield LE Beta VS2012/13) : The registry key the prerequisite (VSTO_Redist.exe) was checking was wrong. The actual key to check for my installation was: "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSTO Runtime Setup\v4R" I have also updated the file CheckSum and file version according to the link to VSTO download: URL="http://go.microsoft.com/fwlink/?LinkId=158918" (this link is provided in the Bootstrap for Publishing).

The Detailed edited prerequisite file that worked for me is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<SetupPrereq>
<conditions>
    <condition Type="32" Comparison="2" Path="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSTO Runtime Setup\v4R" FileName="Version" ReturnValue="10.0.40820.0" Bits="2"></condition>
</conditions>
<files>
    <file LocalFile="&lt;ISProductFolder&gt;\SetupPrerequisites\VSTOR\vstor_redist.exe" URL="http://go.microsoft.com/fwlink/?LinkId=158918" CheckSum="197e479106a8b976fe584706657b4756" FileSize="0,40058880"></file>
</files>
<execute file="vstor_redist.exe" returncodetoreboot="1641,3010" requiresmsiengine="1">
</execute>
<properties Id="YOUR GUID GOES HERE" Description="This prerequisite installs the most recent version of the Microsoft Visual Studio 2010 Tools for Office Runtime." >
</properties>

</SetupPrereq>

You need to replace the "YOUR GUID GOES HERE" with a GUID generated using the tool from the tools menu. (See the help file:http://msdn.microsoft.com/en-us/library/cc442767(v=vs.110).aspx for the methodology for updating a prerequisite)

The help file above mentioned has also the wrong recommendation for x64 build. The registry key recommended: "If you’re creating an installer for 64-bit versions of Office, the entire hierarchy is HKEY_USER_SELECTABLE\Software\Wow6432Node\Microsoft\Office\Excel\Addins\SampleCompany.ExcelAddIn." is actually for All Users, x86 Office running in x64 Windows.

The right registry keys to use can be found in: VSTO add-in control does not appear automatically

Finally: InstallShield LE Beta version VS2012/13 will determine the Target (x86 or x64) according to a) The [INSTALLDIR] folder (i.e.: whether is "Program Files" or "Program Files (x86)" in an x64 Windows) or if any of the components is defined as 64 Bit. See the InstallShield Help File for details (look for "64 Bit" in the Index). InstallShield LE does not expose the property "Template Summary Code" that is used to determine the x86 or x64 Target in Full Versions of InstallShield.

I hope that this helps someone.