title: VC redistributable fails to install when executed within an MSI
body: <p>I have an installer made using WiX, that includes and executes the VC 2019 redistributable installer. My application depends on VC 2015, VC 2017 and VC 2019 due to several 3rd-party binaries.</p>
  <p>I'm installing the redistributable using the <code>/install /passive /norestart</code> parameters, and it's done after the rest of files are copied.</p>
  <p>My issue is that the application (the one installed) fails to start because it cannot find the msvcr140.dll is missing (as well as other 2015's runtime files).</p>
  <p>If I then manually launch the VC redistributable (from command line) using exactly the same parameters, then the application starts correctly.</p>
  <p>I'm elevating the installer on launch and I can see the vcredist is launched after my MSI finished copying files. Am I missing something</p>
  <p>Note: I haven't trying the Merge modules yet, but I'm curious about why is the vcredist installer not working.</p>
  <p>A simplified version of my WXI file is:</p>
  <p>
  
  </p>
  <pre><code>&lt;Property Id=&quot;WIXUI_INSTALLDIR&quot; Value=&quot;DIR_APPLICATION&quot; /&gt;
  
  &lt;!-- Directory structure --&gt;
  &lt;Directory Id=&quot;TARGETDIR&quot; Name=&quot;SourceDir&quot;&gt;
    &lt;!-- Main installation --&gt;
    &lt;Directory Id=&quot;ProgramFilesFolder&quot;&gt;
      &lt;Directory Id=&quot;DIR_COMPANY&quot; Name=&quot;CompanyName&quot;&gt;
        &lt;Directory Id=&quot;DIR_APPLICATION&quot; Name=&quot;TheProduct&quot;&gt;
          &lt;Directory Id=&quot;DIR_INSTALLATION&quot; Name=&quot;vcredists&quot;&gt;
            &lt;Component Id=&quot;VCREDISTRIBUTABLE_142&quot; Guid=&quot;*&quot;&gt;
              &lt;File Id=&quot;FILE_VCREDISTRIBUTABLE_142_EXE&quot; Name=&quot;vcredist_142_x86.exe&quot; Source=&quot;..\VC_redistributables\v142\vcredist_x86.exe&quot; /&gt;
            &lt;/Component&gt;
          &lt;/Directory&gt;
        &lt;/Directory&gt;
      &lt;/Directory&gt;
    &lt;/Directory&gt;
  &lt;/Directory&gt;
  
  &lt;Feature Id=&quot;FEATURE_PRODUCT&quot; Title=&quot;PRODUCT&quot; Level=&quot;1&quot;&gt;
    &lt;ComponentGroupRef Id=&quot;PRODUCT_FILES&quot; /&gt;
    &lt;ComponentRef Id=&quot;VCREDISTRIBUTABLE_142&quot; /&gt;
  &lt;/Feature&gt;
  
  &lt;CustomAction Id=&quot;INSTALL_VCREDISTRIBUTABLE_142&quot; Directory=&quot;DIR_INSTALLATION&quot; ExeCommand='&quot;[DIR_INSTALLATION]vcredist_142_x86.exe&quot; /install /passive /norestart' Execute=&quot;deferred&quot; Impersonate=&quot;no&quot; Return=&quot;ignore&quot; /&gt;
  
  &lt;InstallExecuteSequence&gt;
    &lt;Custom Action=&quot;INSTALL_VCREDISTRIBUTABLE_142&quot; After=&quot;InstallFiles&quot;&gt;&lt;![CDATA[NOT Installed]]&gt;&lt;/Custom&gt;
  &lt;/InstallExecuteSequence&gt;
  
  &lt;UI Id=&quot;UI_Main&quot;&gt;
    &lt;ProgressText Action=&quot;INSTALL_VCREDISTRIBUTABLE_142&quot;&gt;Installing Visual C++ redistributables&lt;/ProgressText&gt;
  
    &lt;UIRef Id=&quot;WixUI_InstallDir&quot; /&gt;
    &lt;Publish Dialog=&quot;WelcomeDlg&quot;
             Control=&quot;Next&quot;
             Event=&quot;NewDialog&quot;
             Value=&quot;InstallDirDlg&quot;
             Order=&quot;2&quot;&gt;1&lt;/Publish&gt;
    &lt;Publish Dialog=&quot;InstallDirDlg&quot;
             Control=&quot;Back&quot;
             Event=&quot;NewDialog&quot;
             Value=&quot;WelcomeDlg&quot;
             Order=&quot;2&quot;&gt;1&lt;/Publish&gt;
    &lt;UIRef Id=&quot;WixUI_ErrorProgressText&quot; /&gt;
  &lt;/UI&gt;
  </code></pre>
    
  <p>Update: the <code>vcredist_142_x86.exe</code> I mention in the above file is a copy of <a href="https://aka.ms/vs/16/release/vc_redist.x86.exe" rel="nofollow noreferrer">https://aka.ms/vs/16/release/vc_redist.x86.exe</a></p>