views:

1541

answers:

4

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  A: 

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"&gt;

    <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.

Wim Coenen
what id really like to do is download the framework only if its missing and not cause my normal installer to be 2 megs bigger
Sam Saffron
AFAIK that's what my example does.
Wim Coenen
@wcoenen, yep, this is a key scenario for Burn (the to-be-developed WiX toolset bootstrapper).
Rob Mensching
+1  A: 

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.

Christopher Karper
+1  A: 

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.

Sam Saffron
+1  A: 

dotNetInstaller supports all this

dblock
this does look helpful
Sam Saffron