0

I written windows service in c# which reads some data from registry.Then I created windows installer using visual Studio 2010 for that service and also adding data to registry required for service. My problem is installer starts installing service before adding data to installer.I wanted to add data to registry before installing service so that it can use that data.

4

2 回答 2

1

如果您使用诸如 WiX (Windows Installer for XML) 或 Installshield 之类的安装程序,您将能够使用标准 MSI 说明将您的注册表设置作为安装的一部分。

然后,当您的服务启动时,注册表设置将按预期出现。

顺便说一句,使用自安装功能(通过 Installutil)对于调试和开发很方便,但不建议用于生产安装。

就我个人而言,我使用 WiX 来满足我的所有安装需求,因为它既免费又非常灵活。

于 2012-07-22T11:53:21.177 回答
0

您正在寻找的内容与InstallerClass

您可以在InstallerClass安装之前、期间或之后覆盖许多事件。

查看此链接以开始使用:

http://devblog.grinn.net/2008/02/windows-services-in-c-part-3-getting.html

于 2012-07-12T08:23:25.453 回答