简体   繁体   English

Wix是用于以编程方式创建此Windows Service安装程序的正确技术吗?

[英]Is Wix it the correct technology to use for programmatically creating this Windows Service installer?

I have 3 components, all built in C# or JS: An agent, an application server, and a website. 我有3个组件,全部用C#或JS内置:一个代理,一个应用服务器和一个网站。

This is the operation of the application. 这是应用程序的操作。 The user goes to the website and downloads an agent installer to their computer. 用户访问该网站并将代理安装程序下载到他们的计算机上。 This agent installer must install an agent identified by the user's unique ID. 该代理安装程序必须安装由用户的唯一ID标识的代理。 The user installs the unique-user-ID agent to their computer. 用户将唯一用户ID代理安装到他们的计算机上。 The unique-user-ID agent installs as a Windows Service and reports data to an application server, which feeds data to the website for the user to view. 唯一用户ID代理作为Windows服务安装,并将数据报告给应用程序服务器,该服务器将数据提供给网站以供用户查看。

I need to programmatically create the unique-user-ID agent installer. 我需要以编程方式创建唯一用户ID代理安装程序。 I figured I could do this by changing a config file before it goes into the agent installer. 我认为可以通过在配置文件进入代理安装程序之前对其进行更改来实现此目的。 I could have all of the dlls, config files, etc. set aside in the folder. 我可以将所有dll,配置文件等放在该文件夹中。 When the user wants to download an agent, I would record the requesting user's unique ID, put it into a config file, and then create the installer with the edited config file. 当用户想要下载代理时,我会记录发出请求的用户的唯一ID,将其放入配置文件中,然后使用编辑后的配置文件创建安装程序。

My questions are: 我的问题是:

  1. Will Wix allow me to create an installer for a Windows Service? Wix会允许我为Windows服务创建安装程序吗?
  2. Can I program when and what to put into an installer made with Wix? 我可以对何时使用Wix制作的安装程序进行编程,以及将哪些内容放入?

I maintain an open source project called Industrial Strength Windows Installer XML (IsWiX) found on CodePlex . 我维护了一个在CodePlex上找到的名为Industrial Strength Windows Installer XML(IsWiX)的开源项目。

Windows Installer is perfectly suited to install Windows Services. Windows Installer非常适合安装Windows Services。 WiX can author Windows Installer databases but the XML can take awhile to learn. WiX可以编写Windows Installer数据库,但XML可能需要一段时间才能学习。 This is where IsWiX comes into the story. 这就是IsWiX的故事。

IsWiX offers multi project solution templates that act as scaffolding handling most of the initial decisions a setup developer would have. IsWiX提供了多个项目解决方案模板,这些模板可作为脚手架来处理安装开发人员将要做出的大多数初始决策。 It then offers graphical designers that allow you to do things like drag and drop files and define services. 然后,它提供图形设计器,使您可以执行诸如拖放文件和定义服务之类的事情。

Once your installer becomes more complex then IsWiX can handle you simple start coding WiX XML by hand. 一旦您的安装程序变得更加复杂,IsWiX就可以帮助您简单地开始手工编写WiX XML。

I have a video on You Tube that demonstrates: 我在You Tube上有一个视频,演示:

1) Create a Windows Service in C#/.NET (40 seconds) 1)在C#/。NET中创建Windows服务(40秒)

2) Create A Windows Installer package using WiX / IsWiX (53 seconds) 2)使用WiX / IsWiX创建Windows Installer程序包(53秒)

3) Install the MSI, Test, Uninstall, Test (43 seconds) 3)安装MSI,测试,卸载,测试(43秒)

This takes a grand total of 2 minutes 17 seconds. 这总共需要2分17秒。 I don't know any other tool in the world that is that fast. 我不知道世界上还有其他工具可以这么快。 I have similar stories for WPF/Winforms desktop applications and IIS/ASP.NET Web Applications. 对于WPF / Winforms桌面应用程序和IIS / ASP.NET Web应用程序,我也有类似的故事。

You can see the video here . 您可以在此处观看视频。

  1. Yes
  2. Yes

For an example of a wix installer that installs a windows service you can take a look at this post by Chris Schiffhauer - http://www.schiffhauer.com/wix-template-for-installing-a-windows-service/ 有关安装Windows服务的wix安装程序的示例,请查看Chris Schiffhauer的这篇文章-http: //www.schiffhauer.com/wix-template-for-installing-a-windows-service/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM