none
using MSBuild to generate a bootstrapper for the 3.5 Framework

    Question

  • I am working on a project that recently upgraded from .NET 2.0 to .NET 3.5.  I had my automated build creating the .NET Framework 2.0 Bootstrapper for my install using the following xml in my .msbuild file:

     

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

     <ItemGroup>
      <BootstrapperFile Include="Microsoft.Net.Framework.2.0">
       <ProductName>Microsoft .NET Framework 2.0</ProductName>
      </BootstrapperFile>
     </ItemGroup>
     <Target Name="Bootstrapper">
      <GenerateBootstrapper
       ApplicationFile="MyApplication.msi"
       ApplicationName="My Application"
       BootstrapperItems="@(BootstrapperFile)"
       OutputPath="$(Root)\MyApplication\"
       ComponentsLocation="HomeSite"
       Culture="en"
      />
     </Target>

    </Project>

    Now, when I try to generate the bootstrapper for 3.5 I get the following warning form msbuild...

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

     <ItemGroup>
      <BootstrapperFile Include="Microsoft.Net.Framework.3.5">
       <ProductName>Microsoft .NET Framework 3.5</ProductName>
      </BootstrapperFile>
     </ItemGroup>
     <Target Name="Bootstrapper">
      <GenerateBootstrapper
       ApplicationFile="MyApplication.msi"
       ApplicationName="My Application"
       BootstrapperItems="@(BootstrapperFile)"
       OutputPath="$(Root)\MyApplication\"
       ComponentsLocation="HomeSite"
       Culture="en"
      />
     </Target>

    </Project>

     

    "warning MSB3155: Item 'Microsoft.Net.Framework.3.5' could not be located in 'C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bootstrapper'

     

    I tried updating the ToolsVersion using the following in the Project node based on a forum posting I found, but this did not change my warning message.

     

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

     

    Any assistance would be greatly appreciated.

     

    Amy

    Tuesday, May 06, 2008 7:54 PM

Answers

  • Hi,

    Even I was trying to get a bootstrapper for .net 3.5.

    Finally after lotta struggle, I got it working :-)

     

    This is the msbuild bootstrapper file test.proj.

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

    <ItemGroup>

    <BootstrapperFile Include="Microsoft.Net.Framework.3.5">

    <ProductName>Microsoft .NET Framework 3.5</ProductName>

    </BootstrapperFile>

    <BootstrapperFile Include="Microsoft.Windows.Installer.3.1">

    <ProductName>Windows Installer 3.1</ProductName>

    </BootstrapperFile>

    </ItemGroup>

    <Target Name="Bootstrapper">

    <GenerateBootstrapper

    ApplicationFile="WixSample.msi"

    ApplicationName="Wix Sample"

    BootstrapperItems="@(BootstrapperFile)"

    ComponentsLocation="HomeSite"

    Culture="en"

    />

    </Target>

    </Project>

     

    Since we are using ToolsVersion="3.5", we need to use msbuild of .net framework 3.5

    Open cmd prompt. Change directory to C:\WINDOWS\Microsoft.NET\Framework\v3.5\.

    Then use msbuild to get the bootstrapper Setup.exe - msbuild test.proj /target:Bootstrapper.

     

    This Setup.exe will check for .NET 3.5, download and install it if needed, and finally invoke Applications msi installer.:-)

     

    Note: The following is my inference based on my experience.

    [If VS 2005 IDE Build option or .net 2.0’s msbuild is used, we will get a few warnings like below and the bootstrapper doesn’t get generated properly.

     

    "warning MSB3164: No 'HomeSite' attribute has been provided for '.NET Framework 3.5', so the package will be published to the same location as the bootstrapper."

    "warning MSB3155: Item 'Microsoft.Net.Framework.3.5' could not be located in 'C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bootstrapper']

     

    Hope this information is useful.

     

    Useful Links:

    http://www.wixwiki.com/index.php?title=Deploying_Additional_Components

    http://msdn.microsoft.com/en-us/library/ms164294.aspx

    http://www.nabble.com/Problem-when-trying-to-install-.NET-framwork-2.0-during-MSI-install-,-plz-any-idea-td17133622.html

     

     

     

     

    • Proposed as answer by bo.skjoett Friday, May 30, 2008 9:01 AM
    • Marked as answer by Feng Chen Monday, June 02, 2008 8:18 AM
    Friday, May 23, 2008 7:06 AM

All replies

  • Try adding this attribute to the GenerateBootstrapper element:

     

    Path="C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper"

     

    The location of the boostrapper packages have changed from Visual Studio 2005 to 2008.

     

    Hope this helps

    Bo

    Tuesday, May 20, 2008 12:45 PM
  • I am struggling with a boostrapper for .NET framework 3.5 myself.

     

    I am building a bootstrapper with MSBuild using a bootstrapper task as above. When I build the target I get a lot of warnings saying:

    "warning MSB3164: No 'HomeSite' attribute has been provided for '.NET Framework 3.5', so the package will be published to the same location as the bootstrapper."

     

    How can I avoid this warning?

    The bootstrapper does not work - it does not install .NET 3.5 before launching the .msi installer for my application.

     

    When I generate the bootstrapper I get a folder called DotNetFX35 containing 200 MB. I don't like to distribute an installer of that size - isn't is possible to make a bootstrapper that will download the .NET 3.5 installer from the web during installation?

     

    Any help is appreciated

    Bo

    Tuesday, May 20, 2008 1:49 PM
  • Hi,

    Even I was trying to get a bootstrapper for .net 3.5.

    Finally after lotta struggle, I got it working :-)

     

    This is the msbuild bootstrapper file test.proj.

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

    <ItemGroup>

    <BootstrapperFile Include="Microsoft.Net.Framework.3.5">

    <ProductName>Microsoft .NET Framework 3.5</ProductName>

    </BootstrapperFile>

    <BootstrapperFile Include="Microsoft.Windows.Installer.3.1">

    <ProductName>Windows Installer 3.1</ProductName>

    </BootstrapperFile>

    </ItemGroup>

    <Target Name="Bootstrapper">

    <GenerateBootstrapper

    ApplicationFile="WixSample.msi"

    ApplicationName="Wix Sample"

    BootstrapperItems="@(BootstrapperFile)"

    ComponentsLocation="HomeSite"

    Culture="en"

    />

    </Target>

    </Project>

     

    Since we are using ToolsVersion="3.5", we need to use msbuild of .net framework 3.5

    Open cmd prompt. Change directory to C:\WINDOWS\Microsoft.NET\Framework\v3.5\.

    Then use msbuild to get the bootstrapper Setup.exe - msbuild test.proj /target:Bootstrapper.

     

    This Setup.exe will check for .NET 3.5, download and install it if needed, and finally invoke Applications msi installer.:-)

     

    Note: The following is my inference based on my experience.

    [If VS 2005 IDE Build option or .net 2.0’s msbuild is used, we will get a few warnings like below and the bootstrapper doesn’t get generated properly.

     

    "warning MSB3164: No 'HomeSite' attribute has been provided for '.NET Framework 3.5', so the package will be published to the same location as the bootstrapper."

    "warning MSB3155: Item 'Microsoft.Net.Framework.3.5' could not be located in 'C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bootstrapper']

     

    Hope this information is useful.

     

    Useful Links:

    http://www.wixwiki.com/index.php?title=Deploying_Additional_Components

    http://msdn.microsoft.com/en-us/library/ms164294.aspx

    http://www.nabble.com/Problem-when-trying-to-install-.NET-framwork-2.0-during-MSI-install-,-plz-any-idea-td17133622.html

     

     

     

     

    • Proposed as answer by bo.skjoett Friday, May 30, 2008 9:01 AM
    • Marked as answer by Feng Chen Monday, June 02, 2008 8:18 AM
    Friday, May 23, 2008 7:06 AM
  • Thanks Diya,

    Setting ToolsVersion="3.5" did the job.

    /Bo

    Friday, May 30, 2008 9:09 AM