Making WiX Bootstrapper work for bootstrapping with .NET 4.0

纵饮孤独 提交于 2020-01-02 06:57:08

问题


I've been looking to make my bootstrapper work with installing .NET 4.0 and my own application. I reviewed several blogs and tutorials, but I can't get it to work.

I read in Stack Overflow question Initiate / call bootstrapper in WiX that you need to invoke both in the bootstrapper. My bootstrapper only invokes the .NET 4.0 installer. This is the part that should invoke both parts:

<Chain>
    <PackageGroupRef Id="NetFx40Redist" />
    <MsiPackage SourceFile="C:\my app.msi" Cache="yes" Visible="no" After="NetFx40Redist"></MsiPackage>
</Chain>

It only invokes the packagegroupref. While installing the .NET 4.0 package, it gives an error. It's probably something easy and small, but I can't find it.


回答1:


The following works for me:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Bundle Name="Bootstrapper1" Version="1.0.0.0" Manufacturer="Test" UpgradeCode="5e5f0f1e-58e0-42e5-8306-37533d677535">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
    <Variable Name="InstallFolder" Type="string" Value="[ProgramFilesFolder]Test\App"/>

    <Chain>
      <PackageGroupRef Id="NetFx40Web" />
      <MsiPackage
        Id="Setup"
        Compressed="yes"
        SourceFile="$(var.SetupProject1.TargetPath)"
        Vital="yes">
        <MsiProperty Name="INSTALLLOCATION" Value="[InstallFolder]" />
      </MsiPackage>
    </Chain>
  </Bundle>
</Wix>

Make sure you add your project and WixNetFxExtension as references to the bootstrapper project. I found this blog very helpful.



来源:https://stackoverflow.com/questions/13174507/making-wix-bootstrapper-work-for-bootstrapping-with-net-4-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!