简体   繁体   English

如何以编程方式创建MSI安装程序?

[英]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 任何帮助将受到高度赞赏

I recommend you use WiX . 我建议你使用WiX It is a very powerful installer building tool. 它是一个非常强大的安装程序构建工具。 You can use it to create the install files using the command line tools, which can be used from your build program. 您可以使用命令行工具使用它来创建安装文件,这些工具可以在构建程序中使用。

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.

相关问题 如何在 Visual Studio 中创建 MSI 安装程序? - How to Create an MSI Installer in Visual Studio? MVC 核心 MSI 构建器,如何创建安装程序? - MVC core MSI builder, how to create installer? 如何使用自定义许可证验证在VS2010中创建msi安装程序 - how to create msi installer in VS2010 with custom licence validation 如何在MSI安装程序中设置路径? - how to set path in MSI installer? MSI 安装程序不会创建空目录 - MSI Installer does not create empty directory 如何使用Wix Toolset为ASP.NET Core应用程序创建MSI安装程序 - How to create MSI installer for ASP.NET Core application using Wix Toolset 如何创建不需要管理员访问权限的Windows安装程序MSI - How can I create a windows installer MSI that does not require admin access 如何使用安装项目创建不需要管理员访问权限的 Windows 安装程序 MSI? - How can I create a windows installer MSI that does not require admin access using setup project? 如何为自包含的控制台应用程序Visual Studio C#创建.msi安装程序 - How to create .msi installer for self contained console app Visual Studio C# 如何使用Visual Studio 2010为C#Web服务项目创建.msi安装程序? - How do I create an .msi installer with Visual Studio 2010 for a C# webservices project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM