为 Windows 服务创建 MSI 安装程序

编程入门 行业动态 更新时间:2024-10-12 03:22:42
本文介绍了为 Windows 服务创建 MSI 安装程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我在 Visual Studio 2008 中有一个 Windows 服务项目.我还添加了设置和部署项目.不幸的是,当我安装它时,该服务没有显示在服务 MMC 管理单元中.

I have a Windows Service project in Visual Studio 2008. I've also added the setup and deployment project. Unfortunately, when I install it, the service does not show up in the services MMC snapin.

我已经将 ProjectInstaller 添加到服务项目中,并且我已按照说明操作 这里 已经.

I have already added the ProjectInstaller to the service project, and I've followed the instructions here already.

推荐答案

您正在寻找的(并且那篇文章没有任何内容,我可以看到)是 ProjectInstaller 类.如果您在设计视图中打开您的服务,您可以右键单击并选择添加安装程序".这会为您的项目添加一个类,默认情况下(我认为)ProjectInstaller.cs.在设计视图中,您将看到两个默认名称为 ServiceProcessInstaller1 和 ServiceInstaller1 的项目.更改您希望服务在哪个帐户下运行的每个属性、服务名称、描述等.

What you're looking for (and that article has nothing on this, that I can see) is a ProjectInstaller class. If you open your service up in design view, you can right-click and select "Add Installer." This adds a class to your project called, by default (I think), ProjectInstaller.cs. In design view, you will see two items with the default names ServiceProcessInstaller1 and ServiceInstaller1. Change the properties on each for what account you want your service to run under, what the service name is, description, etc.

然后,在您的 MSI 项目中,单击自定义操作编辑器"图标并将来自 YourServiceProject 的主要输出"添加到所有操作、安装、提交、回滚和卸载.

Then, in your MSI project, click on the Custom Actions Editor icon and add the "Primary output from YourServiceProject" to all of the actions, Install, Commit, Rollback, and Uninstall.

这是 Microsoft 的旧版演练.

祝你好运.

这篇关于为 Windows 服务创建 MSI 安装程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-27 12:15:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1154790.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:安装程序   Windows   MSI

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!