继续上一个问题我在这里问 https://stackoverflow.com/questions/1128734/how-do-i-make-a-wix-installer-with-a-completely-self-contained-net-3-5-sp1-insta,我现在需要转移到vs2010。
我已经获得了 WiX 3.5 的最新每周版本,即 2010 年 6 月 5 日的版本。
这是我的安装程序中的相关行:
<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" />
然而,它就是行不通。在 vs2010 中,.NET Framework 4.0 和 Windows Installer 4.5 文件旁边有感叹号,属性页将它们列为“Unknown BuildAction BootstrapperFile”,并且构建似乎根本没有安装 .NET 4.0。相关警告是:
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>
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>
我通过进入我的机器上的 Visual Studios 2010 的 SDK 引导程序目录 (C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper) 来解决这个问题。下面有一个项目列表,可以通过Wix 并包含在内用于引导。每个文件夹中都有一个名为 Product.xml 的文件。看了帮助后here https://stackoverflow.com/questions/1128734/how-do-i-make-a-wix-installer-with-a-completely-self-contained-net-3-5-sp1-insta为了创建 .NET 3.5 安装程序,我发现 Product 标记中的 ProductCode 属性似乎标识了 boostrap 元素的名称,因此当我将值更改为 C:\Program Files\Microsoft SDKs\Windows\v7 中引用的值时。 0A\Bootstrapper\Packages\DotNetFX40\Product.xml 它有效。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)