views:

390

answers:

3

Continuing a previous question I asked here, I now need to move to vs2010.

I've gotten the most recent weekly build of WiX 3.5, the June 5th 2010 version.

Here's the relevant lines from my installer:

      <ItemGroup>
        <BootstrapperFile Include="Microsoft.Net.Framework.4.0">
          <ProductName>.NET Framework 4.0</ProductName>
        </BootstrapperFile>
        <BootstrapperFile Include="Microsoft.Windows.Installer.4.5">
         <ProductName>Windows Installer 4.5</ProductName>
       </BootstrapperFile>
      </ItemGroup>

and

<GenerateBootstrapper ApplicationFile="MySetup.msi" ApplicationName="MyProgram" BootstrapperItems="@(BootstrapperFile)" Path="C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\" ComponentsLocation="Relative" OutputPath="$(OutputPath)" Culture="en" />

However, it's just not working. In vs2010, there are exclamation points next to the .NET Framework 4.0 and Windows Installer 4.5 files, and the properties page lists them as 'Unknown BuildAction BootstrapperFile', and the build just does not appear to install .NET 4.0 at all. The relevant warning is:

C:\source\depot\project\vs2010\WiXSetup\WiXSetup.wixproj(68,5): warning MSB3155: Item 'Microsoft.Net.Framework.4.0' could not be located in 'C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\'.
+3  A: 

The short answer is to change

<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="C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\"
        ComponentsLocation="Relative"
        OutputPath="$(cddir)"
        Culture="en"/>
</Target>

to

<ItemGroup>
    <BootstrapperFile Include=".NETFramework,Version=v4.0" >
       <ProductName>.NET Framework 4.0</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="C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\"
        ComponentsLocation="Relative"
        OutputPath="$(cddir)"
        Culture="en"/>
</Target>

I figured this out by going into the SDK bootstrapper directory (C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper) on my machine, for Visual Studios 2010. Under there is a list of projects that can be read by Wix and included for bootstrapping. In each folder there is a file called Product.xml. After looking at the help here for creating a .NET 3.5 installer I found that the ProductCode attribute in the Product tag appears to identify the name of the boostrap element, so when I changed the value to that referenced in C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\DotNetFX40\Product.xml it worked.

Jon
This got it, thanks. I'm glad they decided to change the structure of their commands, that was very helpful and necessary. </sarcasm>
mmr
+1  A: 

Thank you very much for posting you solution to this issue. When I upgraded to Visual Studio 2010, my bootstrapper for .NET 3.5 SP1 stopped working!

I have one question that I was hoping you could answer. What do I need to include for this bootstrapper to work? I am building the WIX project locally on a development machine but the MSI itself is being placed out on a Production server for access by clicking on a link. Do I need to include the DotNetFX40 and WindowsInstaller3_1 folders out there as well or do I need to change the bootstrapper file locations to point to locations out on my Production server?

Thanks!

Ken Tola
I haven't done the .NET 4.0 on a production server (yet), but the eventual goal is to have it there for Hudson. Ideally, the Hudson server would have a complete vs2010 installation. If that's not feasible for whatever reason, copy over the bootstrapper directories (C:\Program Files\Microsoft SDKs\Windows\v7.0A\<everything that's here>) to the same place on the Hudson machine, and the build should work.
mmr
A: 

I'm trying to do the same thing, and having similar issues.

I started with these instructions from the WiX manual: http://wix.sourceforge.net/manual-wix3/install_dotnet.htm except that I'm using VS2010, WiX 3.5.2117.0 and .NET 4.0

I replaced the text as shown in Jon's reply. I still get the exclaimation point error reported in Mmr's original post.

Any suggestions?

RWW