Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
618 views
in Technique[技术] by (71.8m points)

msbuild - How do I make a WiX installer with a completely self-contained .NET 3.5 sp1 installer?

I need to include the full .NET 3.5 sp1 installer into my installer, which is in WiX.

I need that boostrapper to be entirely self contained, with no web access at all. It is just not allowed for this installer to require the web; we have customers in outer Mongolia (I'm serious, not just using the place name because it's remote) to whom we ship CDs because they do not have internet access at all.

The WiX tutorial states:

<Target Name="AfterBuild">
    <GenerateBootstrapper ApplicationFile="$(TargetFileName)" 
                      ApplicationName="My Application Name"
                      BootstrapperItems="@(BootstrapperFile)"
                      ComponentsLocation="Relative"
                      CopyComponents="True"
                      OutputPath="$(OutputPath)"
                      Path="C:Program FilesMicrosoft SDKsWindowsv6.0ABootstrapper"/>
</Target>

The above bootstrapper requires the web. How do I make an installer that does not?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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

    <Target Name="setup">
        <GenerateBootstrapper
            ApplicationFile="myproduct.msi"
            ApplicationName="myproduct"
            BootstrapperItems="@(BootstrapperFile)"
            Path="$(bootstrapperPackagesFolder)"
            ComponentsLocation="Relative"
            OutputPath="$(cddir)"
            Culture="en"/>
    </Target>

</Project>

In your case, the $(bootstrapperPackagesFolder) variable would point to C:Program FilesMicrosoft SDKsWindowsv6.0ABootstrapper. The $(cddir) variable is the folder where you compose the content of your installation CD.

The GenerateBootStrapper task will not only generate a bootstrapper exe, but will also copy a DotNetFX35SP1 and a WindowsInstaller3_1 folder to the same location. During installation, the bootstrapper exe will look for those folders and use the files in there, rather than downloading them.

I'm not sure if my example is different from what you are already doing; maybe you just forgot to include the DotNetFX35SP1 folder on the installation CD?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...