如何使用Wix安装.NET Framework的可再发行包? [英] How to install redistributable package of .NET Framework with Wix?

查看:725
本文介绍了如何使用Wix安装.NET Framework的可再发行包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个一般的任务:在我的产品安装过程中安装.NET Framework 3.5。



我做了以下操作:


  1. 我创建了一个自定义操作X

  2. 自定义操作X通过Process.Start()
  3. $ b启动可执行文件Y $ b
  4. 可执行文件Y杀死msiexec进程并运行.NET Framework安装程序包

这里出现一些问题:.NET Framework设置说Windows Installer服务是不可访问的,并要求终止所有其他安装!



我认为,其原因是Process.Kill()方法终止进程不正确。当我通过Kill()杀死msiexec进程时, msiserver 服务不可停止,但是如果通过单击取消按钮完成设置,则 msiserver 服务将变为STOPPABLE。



如何解决问题?

解决方案

这是如何引导的。 NET框架。



1)确保您的构建机器上有.NET 3.5和Windows Installer 3.1 boostrappers。它们应该与VS一起安装。他们可能会在这里找到:C:\程序文件(x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFX35。



2)编辑wix项目文件。
- 右键单击​​项目,选择卸载
- 再次右键单击并编辑wixproj



3)添加以下项目组:

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



4)项目文件的结尾

 < Target Name =AfterBuild> 
< GenerateBootstrapper ApplicationFile =$(TargetFileName)ApplicationName =我的应用程序名称BootstrapperItems =@(BootstrapperFile)ComponentsLocation =RelativeCopyComponents =TrueOutputPath =$(OutputPath)Path = C:\程序文件(x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\/>< / Target>

5)现在构建。所得到的setup.exe& msi应该安装框架。



Scott


I have a general task: install .NET Framework 3.5 during the setup of my product.

I do the following:

  1. I have created a custom action X
  2. Custom action X starts an executable Y via Process.Start()
  3. Executable Y kills the msiexec process and run .NET Framework setup package

Here appear some problems: .NET Framework setup says that Windows Installer Service is not accessible and asks to terminate all another installations!

I think, the cause of it is that Process.Kill() method terminate the process incorrect. When I kill the msiexec process via Kill() the msiserver service is NOT STOPPABLE, but if I finish setup by clicking Cancel button, msiserver service becomes STOPPABLE.

How can I solve the problem?

解决方案

Here is how to bootstrap the .NET framework.

1) Be sure you have the .NET 3.5 and Windows Installer 3.1 boostrappers on your build machine. They should be installed with VS. They can likely be found here: C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFX35.

2) Edit the wix project file. - Right click on the project, select unload - Right click again, and edit the wixproj

3) Add the following item group:

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

4) Add the following at the end of the project file

    <Target Name="AfterBuild">
  <GenerateBootstrapper ApplicationFile="$(TargetFileName)" ApplicationName="My Application Name" BootstrapperItems="@(BootstrapperFile)" ComponentsLocation="Relative" CopyComponents="True" OutputPath="$(OutputPath)" Path="C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\" /></Target>

5) Now build. The resulting setup.exe & msi should install the framework.

Scott

这篇关于如何使用Wix安装.NET Framework的可再发行包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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