如何使用完全独立的.NET 4.0安装程序制作WiX 3.5安装程序? [英] How do I make a WiX 3.5 installer with a completely self-contained .NET 4.0 installer?

查看:85
本文介绍了如何使用完全独立的.NET 4.0安装程序制作WiX 3.5安装程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

继续上一个问题我在这里问,我现在需要转到vs2010。

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

我已经获得了最新的每周版本WiX 3.5,2010年6月5日版本。

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>

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

但是,它只是无法正常工作。在vs2010中,.NET Framework 4.0和Windows Installer 4.5文件旁边有一个感叹号,并且属性页将它们列出为 Unknown BuildAction BootstrapperFile,并且该构建似乎根本没有安装.NET 4.0。相关警告是:

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


推荐答案

简短的答案是改变

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


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

我想通了这一点进入我机器上用于Visual Studios 2010的SDK引导程序目录(C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper)。下面是Wix可以读取的项目列表并用于引导。在每个文件夹中都有一个名为Product.xml的文件。查看帮助后此处用于创建.NET 3.5安装程序,我发现Product标记中的ProductCode属性似乎标识了boostrap元素的名称,因此当我将值更改为C中引用的值时:\程序文件\Microsoft SDK \Windows\v7.0A\Bootstrapper\Packages\DotNetFX40\Product.xml起作用了。

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.

这篇关于如何使用完全独立的.NET 4.0安装程序制作WiX 3.5安装程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆