RomanVD
RomanVD

Reputation: 27

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

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

Upvotes: 2

Views: 12841

Answers (3)

Matt Dearing
Matt Dearing

Reputation: 9386

It shows the message because the condition is still failing after install, most likely due the path difference on 32 or 64 bit OS's (as @AlBear pointed out). If you are targetting both you can create 2 pre-req files for Install Shield LE each with its own operatingsystemcondition checking for bitness. Add both pre-reqs to your single installer and only the appropriate one will execute (based on the operatingsystemcondition):

32 bit

<conditions>
    <condition Type="32" Comparison="2" Path="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSTO Runtime Setup\v4R" FileName="Version" ReturnValue="10.0.40309" Bits="2"></condition>
    <operatingsystemconditions>
        <operatingsystemcondition Bits="1"/>
    </operatingsystemconditions>
</conditions>

64 bit

<conditions>
    <condition Type="32" Comparison="2" Path="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSTO Runtime Setup\v4R" FileName="Version" ReturnValue="10.0.40309" Bits="2"></condition>
    <operatingsystemconditions>
        <operatingsystemcondition Bits="4"/>
    </operatingsystemconditions>
</conditions>

Upvotes: 1

AlBear
AlBear

Reputation: 61

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.

Upvotes: 6

Christopher Painter
Christopher Painter

Reputation: 55581

I have seen on occasion the .PRQ file provided by InstallShield becomes OBE (overcome by events). For example I've seen Microsoft re-release a redist and keep the URL (fwlink) the same. However the PRQ was authored against an older version of the file causing the filesize and/or file hash to be come invalid. Also there is an artifact that is searched for, evaluated to determine if installation is needed and reevaluated to confirm if installation was successful.

So basically send the PRQ file to the Prereq Editor tool and verify that all of it's assumptions are still correct. Modify if needed.

Upvotes: 0

Related Questions