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

♀尐吖头ヾ 提交于 2019-12-14 00:27:17

问题


We have decided to take the plunge and require that our users have .NET 3.5 installed before they can use our media center plug-in.

I want to make sure the install experience is as smooth as possible and that our installer stays small.

What changes do I need to make to my WiX file to support the following scenarios? Code examples would be much appreciated.

  • User has .Net framework 3.0 installed, interactive install.

Desired Behavior: User is prompted with a window that tells her she needs a new version of the framework, if she accepts, dotNetFx35setup.exe (2.7 MB) is downloaded, and then executed. Finally, the installation proceeds.

  • User has .Net framework 3.0 installed, non-interactive install.

Background: To facilitate auto-updates from within media center, we may execute "msiexec.exe /qb /i mediabrowser.msi" if a user elect to upgrade an existing version.

Desired behavior: User is prompted with a window that tells her she needs a new version of the framework, if she accepts, dotNetFx35setup.exe (2.7 MB) is downloaded, and then executed. Finally, the installation proceeds silently.

Are there any other open source projects that implement something along these lines?

Related question: Is .NET 3.5 a reasonable pre-requisite for a media center plugin?


回答1:


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.




回答2:


dotNetInstaller supports all this




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/624614/wix-changes-required-to-streamline-net-3-5-installation-for-vista-and-above-m

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