2

I'm writing an installer for my Office Outlook add-in using WiX. The add-in itself requires VS Tools For Office Runtime to be installed. So I thought to install it as a custom-action from within my own WiX installer:

<Binary Id='idBinVstorRedist' SourceFile='Sources\vstor_redist.exe' />

<CustomAction Id="idCSVstorRedist" Return="asyncWait" HideTarget="no" Execute="deferred" Impersonate="no" ExeCommand="" BinaryKey="idBinVstorRedist" />

<InstallExecuteSequence>
  <Custom Action="idCSVstorRedist" After="InstallInitialize">
    NOT Installed
  </Custom>
</InstallExecuteSequence>

where the vstor_redist.exe itself is part of my MSI package:

enter image description here

But when I run my installer it deadlocks in the VstorRedist with the message: "Waiting for another install to complete":

enter image description here

What am I doing wrong here?

c00000fd
  • 20,994
  • 29
  • 177
  • 400

2 Answers2

0

To check whether the VSTO Office Runtime is installed, we’ll add condition and two RegistrySearch elements. RegistrySearch, does exactly what the name implies, it searches the target machines’ registry for a specific key and value.

<Property Id="VSTORUNTIMEREDIST">
  <RegistrySearch 
    Id="VSTORuntimeRedist" 
    Root="HKLM" 
    Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4R" 
    Name="Version" 
    Type="raw" />
</Property>
<Condition 
  Message="The Visual Studio 2010 Tools for Office Runtime is not installed. 
  Please download and install from 
  http://www.microsoft.com/en-us/download/details.aspx?id=20479.">
  <![CDATA[Installed OR VSTORUNTIMEREDIST>="10.0.30319"]]>
</Condition>

Read more about that in the Creating WiX installation projects for VSTO-based Office add-ins article.

Also, you may find the How do you use WiX to deploy VSTO 3.0 addins? article helpful.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • Hmm. I'm not sure this is what I was asking for. Your code shows how to display an error for the end user if VSTO runtime is not installed. I'm asking how to install it. As for "How do you use WiX to deploy VSTO 3.0 addins" link -- I'm sorry, I'm probably not following it, but where does it show how to install VSTO runtime in there? – c00000fd Jun 26 '20 at 21:49
0

It may be due to the fact that your custom action is set to run After="InstallInitialize". I'm trialing running a batch script to install the runtime after checking if it isn't present or not and it appears to be working okay for me like this

    <InstallExecuteSequence>
  <Custom Action="RunBatch" Before="InstallFinalize"/>
</InstallExecuteSequence>
<CustomAction Id="RunBatch"
              Execute="deferred"
              Return="ignore"
              Impersonate="no"
              ExeCommand="&quot;[SystemFolder]cmd.exe&quot; /C &quot;[INSTALLFOLDER]vsto_runtime.bat&quot;"
              Directory="INSTALLFOLDER"/>

This is not the recommended way to install prerequisites but after having issues with creating a bundle, this is a working short term fix for me

Hopefully this is of some use for you.

S1984
  • 81
  • 1
  • 7