[英]How to create an MSI installer programmatically?
I have a program that is used to create other program and compile it from *.cs source file 我有一个程序,用于创建其他程序并从* .cs源文件编译它
using System.CodeDom.Compiler;
I would like to create an installer too for the compiled program but i am wondering if i can do that programmatically, so when i click the Build Now button in my main application, a new installer will appear on a chosen destination. 我想为编译的程序创建一个安装程序,但我想知道我是否可以以编程方式执行此操作,因此当我单击主应用程序中的“立即构建”按钮时,将在所选目标上显示新的安装程序。
Is there someway to create an msi installer for the compiled program ( the program that i have built ) with a button click. 有没有办法通过点击按钮为已编译的程序(我构建的程序)创建一个msi安装程序。
I don't want to use InstallShield everytime i want to create an installer for my compiled programs. 每次我想为编译的程序创建安装程序时,我都不想使用InstallShield。
Any help would be highly appreciated 任何帮助将受到高度赞赏
WiX is now integrated with Deployment Tools Foundation, a complete wrapper around the Windows Installer API. WiX现在与Deployment Tools Foundation集成,它是Windows Installer API的完整包装器。 When you install WiX, you'll get DTF too.This should allow you to address any MSI related scenario programmatically.
当您安装WiX时,您也将获得DTF。这应该允许您以编程方式解决任何与MSI相关的场景。 There's some documentation too, but you'll need a fairly rigorous understanding of MSI databases to get to grips with the API.
还有一些文档,但您需要对MSI数据库有相当严格的了解才能掌握API。 I'd avoid this if possible and go with the WiX route.
如果可能的话,我会避免这种情况,并采用WiX路线。
As vdproj setup projects are being killed off in VS11, learning WiX is a considerably better investment in time than getting to grips with some of the other options VS tries to steer you towards. 由于vdproj安装项目正在VS11中被淘汰,因此学习WiX是一项相当好的投资,而不是掌握VS试图引导你的其他一些选择。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.