toomasz
toomasz

Reputation: 45

Wix - how to prevent installer from closing unrelated applications in repair mode when C++ redistributable is included as merge module?

I need to include Microsoft C++ 2013 redistributable in my installer project. I tired using instructions from Wix documentation: http://wixtoolset.org/documentation/manual/v3/howtos/redistributables_and_install_checks/install_vcredist.html

This is excerpt from .wxs my where I'm including Merge module package:

<Fragment>
<FeatureGroup Id="CompleteFeatures">
  <Feature Id="Complete" Level="1" Title="$(var.PRODUCT)" AllowAdvertise="no"  TypicalDefault="install">
    <!-- app components here -->
  </Feature>


   <Feature Id="VCRedist" Title="C++ Redistributable Package for Visual Studio 2013" AllowAdvertise="no" Display="hidden" Level="1" Absent="disallow">
    <MergeRef Id="VCRedist"/>
  </Feature> 


</FeatureGroup>  

<DirectoryRef Id="APPLICATIONFOLDER">
  <Merge Id="VCRedist" SourceFile="Microsoft_VC120_CRT_x86.msm" DiskId="1" Language="0"/>
</DirectoryRef>

Redistrbutable dlls are installed silently into system32 folder. However when using repair option, installer asks to close miscellaneous applications like visual studio(that is not acceptable):

https://i.sstatic.net/h5Ixd.png

Problem doesn't exist when c++ redistributable package is not included to installer. During uninstall no applications are required to be closed. How can I fix repair option to not require closing unrelated applications?

Upvotes: 0

Views: 204

Answers (2)

toomasz
toomasz

Reputation: 45

I ended up checking if msvcr120.dll is present in system directory and installing redistributable based on that condition.

<Property Id="VC2013_REDIST_INSTALLED">
  <DirectorySearch Id="CheckFileDir" Path="[SystemFolder]" Depth="1">
    <FileSearch Id="CheckFile" Name="msvcr120.dll" />
  </DirectorySearch>
</Property>

Upvotes: 0

Christopher Painter
Christopher Painter

Reputation: 55581

The simplest answer is to not include the C++ merge modules but instead bootstrap the prereqs using burn. This creates the separation you are looking for. In my experience, the merge modules have too many problems to be considered useable. I'm pretty sure MSFT conceded this at some point also.

Upvotes: 0

Related Questions