WiX changes required to streamline .NET 3.5 installation for Vista (and above) machines

半腔热情 提交于 2019-12-04 16:48:42

I believe installing .NET falls under the responsibilities of a setup.exe bootstrapper, before your msi is launched. WIX does not (yet) have its own way to generate a bootstrapper (or if it does, it is not documented in wix.chm). Instead, you can make use of the GenerateBootStrapper msbuild task to generate a setup.exe. Take a look at the topic "How To: Install the .NET Framework Using a Bootstrapper" in the wix documentation. To install .NET 3.5 SP1 by download, your msbuild file would like this:

<Project ToolsVersion="3.5"
   xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

    <ItemGroup>
        <BootstrapperFile Include="Microsoft.Windows.Installer.3.1" >
           <ProductName>Windows Installer 3.1</ProductName>
        </BootstrapperFile>
        <BootstrapperFile Include="Microsoft.Net.Framework.3.5.SP1" >
           <ProductName>Microsoft DotNet Framework 3.5 SP1</ProductName>
        </BootstrapperFile>
    </ItemGroup>

    <Target Name="SetupExe">
        <GenerateBootstrapper
            ApplicationFile="myproduct.msi"
            ApplicationName="myproduct"
            BootstrapperItems="@(BootstrapperFile)"
            Path="C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\"
            OutputPath="path/to/put/setup/"
            Culture="en"/>
    </Target>

</Project>

If you save the above in a setup.msbuild file, you can build your setup by invoking

C:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild.exe setup.msbuild

You can also install .NET from your install CD rather than downloading it. Just add ComponentsLocation="Relative" to the attributes of GenerateBootstrapper.

dotNetInstaller supports all this

You will need to use a bootstrapper to accomplish this. Microsoft Installer will not allow you to kick off another installer once one is already running. There is a bootstrap generator you can use from msbuild files included with Visual Studio, or you can look at many of the open source options.

dotNetInstaller is a popular options. And "Burn" is the name of the forthcoming tool in WiX for this task. But, it's still concept-ware for now.

Sam Saffron

From Rob Mensching the lead WiX developer: this is a key scenario for Burn (the to-be-developed WiX toolset bootstrapper.)

So no, there is no built in way to stramline the process with WiX pure. You could write your own bootstrapper though.

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